class XmlEncoder implements SerializerAwareInterface, EncoderInterface, DecoderInterface (View source)

internal  This encoder should not be used directly. Rather, use the `serializer` service.
 

Adds XML support for serializer.

This acts as a wrapper class for Symfony's XmlEncoder so that it is not implementing NormalizationAwareInterface, and can be normalized externally.

Traits

SerializerAwareTrait

Properties

static protected array $format

The formats that this Encoder supports.

protected XmlEncoder $baseEncoder

An instance of the Symfony XmlEncoder to perform the actual encoding.

Methods

XmlEncoder
getBaseEncoder()

Gets the base encoder instance.

setBaseEncoder(XmlEncoder $encoder)

Sets the base encoder instance.

encode($data, $format, array $context = [])

{@inheritdoc}

supportsEncoding($format)

{@inheritdoc}

decode($data, $format, array $context = [])

{@inheritdoc}

supportsDecoding($format)

{@inheritdoc}

Details

XmlEncoder getBaseEncoder()

Gets the base encoder instance.

Return Value

XmlEncoder

The base encoder.

setBaseEncoder(XmlEncoder $encoder)

Sets the base encoder instance.

Parameters

XmlEncoder $encoder

The XML encoder.

encode($data, $format, array $context = [])

{@inheritdoc}

Parameters

$data
$format
array $context

supportsEncoding($format)

{@inheritdoc}

Parameters

$format

decode($data, $format, array $context = [])

{@inheritdoc}

Parameters

$data
$format
array $context

supportsDecoding($format)

{@inheritdoc}

Parameters

$format