Encoder\XmlEncoder (Component\Serializer)
Symfony\Component\Serializer\Encoder\XmlEncoder
class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, DecoderInterface, NormalizationAwareInterface
Encodes XML data.
Methods
setSerializer(SerializerInterface $serializer) Sets the owning Serializer object. | from SerializerAwareEncoder | |
__construct(string $rootNodeName = 'response') Construct new XmlEncoder and allow to change the root node element name. | ||
scalar | encode(mixed $data, string $format, array $context = array()) Encodes data into the given format. | |
mixed | decode(string $data, string $format, array $context = array()) Decodes a string into PHP data. | |
bool | supportsEncoding(string $format) Checks whether the serializer can encode to given format. | |
bool | supportsDecoding(string $format) Checks whether the deserializer can decode from given format. | |
setRootNodeName(string $name) Sets the root node name. | ||
string | getRootNodeName() Returns the root node name. |
Details
public setSerializer(SerializerInterface $serializer)
Sets the owning Serializer object.
public __construct(string $rootNodeName = 'response')
Construct new XmlEncoder and allow to change the root node element name.
public scalar encode(mixed $data, string $format, array $context = array())
Encodes data into the given format.
public mixed decode(string $data, string $format, array $context = array())
Decodes a string into PHP data.
public bool supportsEncoding(string $format)
Checks whether the serializer can encode to given format.
public bool supportsDecoding(string $format)
Checks whether the deserializer can decode from given format.
public setRootNodeName(string $name)
Sets the root node name.
public string getRootNodeName()
Returns the root node name.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Component/Serializer/Encoder/XmlEncoder.html