public function GetSetMethodNormalizer::setCallbacks

Set normalization callbacks

Parameters

array $callbacks help normalize the result:

File

drupal/core/vendor/symfony/serializer/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php, line 46

Class

GetSetMethodNormalizer
Converts between objects with getter and setter methods and arrays.

Namespace

Symfony\Component\Serializer\Normalizer

Code

public function setCallbacks(array $callbacks) {
  foreach ($callbacks as $attribute => $callback) {
    if (!is_callable($callback)) {
      throw new \InvalidArgumentException(sprintf('The given callback for attribute "%s" is not callable.', $attribute));
    }
  }
  $this->callbacks = $callbacks;
}