function XmlEncoder::getBaseEncoder

Same name in other branches
  1. 9 core/modules/serialization/src/Encoder/XmlEncoder.php \Drupal\serialization\Encoder\XmlEncoder::getBaseEncoder()
  2. 10 core/modules/serialization/src/Encoder/XmlEncoder.php \Drupal\serialization\Encoder\XmlEncoder::getBaseEncoder()
  3. 11.x core/modules/serialization/src/Encoder/XmlEncoder.php \Drupal\serialization\Encoder\XmlEncoder::getBaseEncoder()

Gets the base encoder instance.

Return value

\Symfony\Component\Serializer\Encoder\XmlEncoder The base encoder.

File

core/modules/serialization/src/Encoder/XmlEncoder.php, line 45

Class

XmlEncoder
Adds XML support for serializer.

Namespace

Drupal\serialization\Encoder

Code

public function getBaseEncoder() {
    if (!isset($this->baseEncoder)) {
        $this->baseEncoder = new BaseXmlEncoder();
        $this->baseEncoder
            ->setSerializer($this->serializer);
    }
    return $this->baseEncoder;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.