public function ChainEncoder::needsNormalization

Checks whether the normalization is needed for the given format.

Parameters

string $format:

Return value

Boolean

File

drupal/core/vendor/symfony/serializer/Symfony/Component/Serializer/Encoder/ChainEncoder.php, line 64

Class

ChainEncoder
Encoder delegating the decoding to a chain of encoders.

Namespace

Symfony\Component\Serializer\Encoder

Code

public function needsNormalization($format) {
  $encoder = $this
    ->getEncoder($format);
  if (!$encoder instanceof NormalizationAwareInterface) {
    return true;
  }
  if ($encoder instanceof self) {
    return $encoder
      ->needsNormalization($format);
  }
  return false;
}