final public function ChainEncoder::encode

Encodes data into the given format

Parameters

mixed $data Data to encode:

string $format Format name:

array $context options that normalizers/encoders have access to.:

Return value

scalar

Overrides EncoderInterface::encode

File

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

Class

ChainEncoder
Encoder delegating the decoding to a chain of encoders.

Namespace

Symfony\Component\Serializer\Encoder

Code

public final function encode($data, $format, array $context = array()) {
  return $this
    ->getEncoder($format)
    ->encode($data, $format, $context);
}