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

Breadcrumb

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

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

Code

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

API Navigation

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