protected function AbstractNormalizer::isCircularReference in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/serializer/Normalizer/AbstractNormalizer.php \Symfony\Component\Serializer\Normalizer\AbstractNormalizer::isCircularReference()
Detects if the configured circular reference limit is reached.
Parameters
object $object:
array $context:
Return value
bool
Throws
3 calls to AbstractNormalizer::isCircularReference()
- 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 184
Class
- AbstractNormalizer
- Normalizer implementation.
Namespace
Symfony\Component\Serializer\NormalizerCode
protected function isCircularReference($object, &$context) {
$objectHash = spl_object_hash($object);
if (isset($context['circular_reference_limit'][$objectHash])) {
if ($context['circular_reference_limit'][$objectHash] >= $this->circularReferenceLimit) {
unset($context['circular_reference_limit'][$objectHash]);
return true;
}
++$context['circular_reference_limit'][$objectHash];
}
else {
$context['circular_reference_limit'][$objectHash] = 1;
}
return false;
}