function AbstractObjectNormalizer::createChildContext
Overwritten to update the cache key for the child.
We must not mix up the attribute cache between parent and children.
@internal
Overrides AbstractNormalizer::createChildContext
3 calls to AbstractObjectNormalizer::createChildContext()
- AbstractObjectNormalizer::normalize in vendor/
symfony/ serializer/ Normalizer/ AbstractObjectNormalizer.php - Normalizes data into a set of arrays/scalars.
- AbstractObjectNormalizer::validateAndDenormalize in vendor/
symfony/ serializer/ Normalizer/ AbstractObjectNormalizer.php - Validates the submitted data and denormalizes it.
- AbstractObjectNormalizer::validateAndDenormalizeLegacy in vendor/
symfony/ serializer/ Normalizer/ AbstractObjectNormalizer.php - Validates the submitted data and denormalizes it.
File
-
vendor/
symfony/ serializer/ Normalizer/ AbstractObjectNormalizer.php, line 1060
Class
- AbstractObjectNormalizer
- Base class for a normalizer dealing with objects.
Namespace
Symfony\Component\Serializer\NormalizerCode
protected function createChildContext(array $parentContext, string $attribute, ?string $format) : array {
$context = parent::createChildContext($parentContext, $attribute, $format);
if ($context['cache_key'] ?? false) {
$context['cache_key'] .= '-' . $attribute;
}
elseif (false !== ($context['cache_key'] ?? null)) {
$context['cache_key'] = $this->getCacheKey($format, $context);
}
return $context;
}