Encodes data into the given format
mixed $data Data to encode:
string $format Format name:
array $context options that normalizers/encoders have access to.:
scalar
Overrides EncoderInterface::encode
public final function encode($data, $format, array $context = array()) {
return $this
->getEncoder($format)
->encode($data, $format, $context);
}