public function EncoderInterface::encode in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/serializer/Encoder/EncoderInterface.php \Symfony\Component\Serializer\Encoder\EncoderInterface::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
Throws
7 methods override EncoderInterface::encode()
- ChainEncoder::encode in vendor/
symfony/ serializer/ Encoder/ ChainEncoder.php - Encodes data into the given format.
- JsonEncode::encode in vendor/
symfony/ serializer/ Encoder/ JsonEncode.php - Encodes PHP data to a JSON string.
- JsonEncoder::encode in vendor/
symfony/ serializer/ Encoder/ JsonEncoder.php - Encodes data into the given format.
- SerializationTestEncoder::encode in core/
modules/ serialization/ tests/ serialization_test/ src/ SerializationTestEncoder.php - Encodes data into the given format.
- Serializer::encode in vendor/
symfony/ serializer/ Serializer.php - Encodes data into the given format.
File
- vendor/
symfony/ serializer/ Encoder/ EncoderInterface.php, line 34
Class
- EncoderInterface
- Defines the interface of encoders.
Namespace
Symfony\Component\Serializer\EncoderCode
public function encode($data, $format, array $context = array());