public function Serializer::supportsNormalization

Checks whether the given class is supported for normalization by this normalizer

Parameters

mixed $data Data to normalize.:

string $format The format being (de-)serialized from or into.:

Return value

Boolean

Overrides NormalizerInterface::supportsNormalization

1 call to Serializer::supportsNormalization()
Serializer::normalize in drupal/core/vendor/symfony/serializer/Symfony/Component/Serializer/Serializer.php
Normalizes an object into a set of arrays/scalars

File

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

Class

Serializer
Serializer serializes and deserializes data

Namespace

Symfony\Component\Serializer

Code

public function supportsNormalization($data, $format = null) {
  try {
    $this
      ->getNormalizer($data, $format);
  } catch (RuntimeException $e) {
    return false;
  }
  return true;
}