private function Serializer::getNormalizer

1 call to Serializer::getNormalizer()
Serializer::supportsNormalization in drupal/core/vendor/symfony/serializer/Symfony/Component/Serializer/Serializer.php
Checks whether the given class is supported for normalization by this normalizer

File

drupal/core/vendor/symfony/serializer/Symfony/Component/Serializer/Serializer.php, line 173

Class

Serializer
Serializer serializes and deserializes data

Namespace

Symfony\Component\Serializer

Code

private function getNormalizer($data, $format = null) {
  foreach ($this->normalizers as $normalizer) {
    if ($normalizer instanceof NormalizerInterface && $normalizer
      ->supportsNormalization($data, $format)) {
      return $normalizer;
    }
  }
  throw new RuntimeException(sprintf('No normalizer found for format "%s".', $format));
}