You are here

public function XmlEncoder::getBaseEncoder in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/serialization/src/Encoder/XmlEncoder.php \Drupal\serialization\Encoder\XmlEncoder::getBaseEncoder()
  2. 9 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.

2 calls to XmlEncoder::getBaseEncoder()
XmlEncoder::decode in core/modules/serialization/src/Encoder/XmlEncoder.php
XmlEncoder::encode in core/modules/serialization/src/Encoder/XmlEncoder.php

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;
}