Defines the interface of encoders
@author Jordi Boggiano <j.boggiano@seld.be>
Expanded class hierarchy of EncoderInterface
All classes that implement EncoderInterface
interface EncoderInterface {
/**
* Encodes data into the given format
*
* @param mixed $data Data to encode
* @param string $format Format name
* @param array $context options that normalizers/encoders have access to.
*
* @return scalar
*/
public function encode($data, $format, array $context = array());
/**
* Checks whether the serializer can encode to given format
*
* @param string $format format name
*
* @return Boolean
*/
public function supportsEncoding($format);
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EncoderInterface:: |
public | function | Encodes data into the given format | 7 |
EncoderInterface:: |
public | function | Checks whether the serializer can encode to given format | 7 |