function AttributeLoader::setAttributeContextsForGroups
1 call to AttributeLoader::setAttributeContextsForGroups()
- AttributeLoader::loadClassMetadata in vendor/
symfony/ serializer/ Mapping/ Loader/ AttributeLoader.php
File
-
vendor/
symfony/ serializer/ Mapping/ Loader/ AttributeLoader.php, line 198
Class
- AttributeLoader
- Loader for PHP attributes.
Namespace
Symfony\Component\Serializer\Mapping\LoaderCode
private function setAttributeContextsForGroups(Context $attribute, AttributeMetadataInterface $attributeMetadata) : void {
$context = $attribute->getContext();
$groups = $attribute->getGroups();
$normalizationContext = $attribute->getNormalizationContext();
$denormalizationContext = $attribute->getDenormalizationContext();
if ($normalizationContext || $context) {
$attributeMetadata->setNormalizationContextForGroups($normalizationContext ?: $context, $groups);
}
if ($denormalizationContext || $context) {
$attributeMetadata->setDenormalizationContextForGroups($denormalizationContext ?: $context, $groups);
}
}