You are here

private function Serializer::getDenormalizer in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/serializer/Serializer.php \Symfony\Component\Serializer\Serializer::getDenormalizer()

Returns a matching denormalizer.

Parameters

mixed $data data to restore:

string $class the expected class to instantiate:

string $format format name, present to give the option to normalizers to act differently based on formats:

Return value

DenormalizerInterface|null

2 calls to Serializer::getDenormalizer()
Serializer::denormalizeObject in vendor/symfony/serializer/Serializer.php
Denormalizes data back into an object of the given class.
Serializer::supportsDenormalization in vendor/symfony/serializer/Serializer.php
Checks whether the given class is supported for denormalization by this normalizer.

File

vendor/symfony/serializer/Serializer.php, line 215

Class

Serializer
Serializer serializes and deserializes data.

Namespace

Symfony\Component\Serializer

Code

private function getDenormalizer($data, $class, $format) {
  if (isset($this->denormalizerCache[$class][$format])) {
    return $this->denormalizerCache[$class][$format];
  }
  foreach ($this->normalizers as $normalizer) {
    if ($normalizer instanceof DenormalizerInterface && $normalizer
      ->supportsDenormalization($data, $class, $format)) {
      $this->denormalizerCache[$class][$format] = $normalizer;
      return $normalizer;
    }
  }
}