You are here

protected function AbstractNormalizer::handleCircularReference in Zircon Profile 8

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

Handles a circular reference.

If a circular reference handler is set, it will be called. Otherwise, a {@class CircularReferenceException} will be thrown.

Parameters

object $object:

Return value

mixed

Throws

CircularReferenceException

3 calls to AbstractNormalizer::handleCircularReference()
GetSetMethodNormalizer::normalize in vendor/symfony/serializer/Normalizer/GetSetMethodNormalizer.php
ObjectNormalizer::normalize in vendor/symfony/serializer/Normalizer/ObjectNormalizer.php
PropertyNormalizer::normalize in vendor/symfony/serializer/Normalizer/PropertyNormalizer.php

File

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

Class

AbstractNormalizer
Normalizer implementation.

Namespace

Symfony\Component\Serializer\Normalizer

Code

protected function handleCircularReference($object) {
  if ($this->circularReferenceHandler) {
    return call_user_func($this->circularReferenceHandler, $object);
  }
  throw new CircularReferenceException(sprintf('A circular reference has been detected (configured limit: %d).', $this->circularReferenceLimit));
}