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

Breadcrumb

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

function MetadataAwareNameConverter::denormalize

Overrides AdvancedNameConverterInterface::denormalize

File

vendor/symfony/serializer/NameConverter/MetadataAwareNameConverter.php, line 57

Class

MetadataAwareNameConverter
@author Fabien Bourigault <bourigaultfabien@gmail.com>

Namespace

Symfony\Component\Serializer\NameConverter

Code

public function denormalize(string $propertyName, ?string $class = null, ?string $format = null, array $context = []) : string {
    if (null === $class) {
        return $this->denormalizeFallback($propertyName, $class, $format, $context);
    }
    $cacheKey = $this->getCacheKey($class, $context);
    if (!\array_key_exists($cacheKey, self::$denormalizeCache) || !\array_key_exists($propertyName, self::$denormalizeCache[$cacheKey])) {
        self::$denormalizeCache[$cacheKey][$propertyName] = $this->getCacheValueForDenormalization($propertyName, $class, $context);
    }
    return self::$denormalizeCache[$cacheKey][$propertyName] ?? $this->denormalizeFallback($propertyName, $class, $format, $context);
}
RSS feed
Powered by Drupal