public function ChainEncoder::supportsEncoding

Checks whether the serializer can encode to given format

Parameters

string $format format name:

Return value

Boolean

Overrides EncoderInterface::supportsEncoding

File

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

Class

ChainEncoder
Encoder delegating the decoding to a chain of encoders.

Namespace

Symfony\Component\Serializer\Encoder

Code

public function supportsEncoding($format) {
  try {
    $this
      ->getEncoder($format);
  } catch (RuntimeException $e) {
    return false;
  }
  return true;
}