Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AttributeLoader.php

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\Loader

Code

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);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal