You are here

public function AbstractNormalizer::setCircularReferenceHandler in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/serializer/Normalizer/AbstractNormalizer.php \Symfony\Component\Serializer\Normalizer\AbstractNormalizer::setCircularReferenceHandler()

Set circular reference handler.

Parameters

callable $circularReferenceHandler:

Return value

self

Throws

InvalidArgumentException

File

vendor/symfony/serializer/Normalizer/AbstractNormalizer.php, line 94

Class

AbstractNormalizer
Normalizer implementation.

Namespace

Symfony\Component\Serializer\Normalizer

Code

public function setCircularReferenceHandler($circularReferenceHandler) {
  if (!is_callable($circularReferenceHandler)) {
    throw new InvalidArgumentException('The given circular reference handler is not callable.');
  }
  $this->circularReferenceHandler = $circularReferenceHandler;
  return $this;
}