Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Core/FieldType/RichText/Value.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\FieldType\RichText;
8
9 use eZ\Publish\Core\FieldType\Value as BaseValue;
10 use DOMDocument;
11
17 class Value extends BaseValue
18 {
19 const EMPTY_VALUE = <<<EOT
20 <?xml version="1.0" encoding="UTF-8"?>
21 <section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0-variant ezpublish-1.0"/>
22 EOT;
23
29 public $xml;
30
36 public function __construct($xml = null)
37 {
38 if ($xml instanceof DOMDocument) {
39 $this->xml = $xml;
40 } else {
41 $this->xml = new DOMDocument();
42 $this->xml->loadXML($xml === null ? self::EMPTY_VALUE : $xml);
43 }
44 }
45
49 public function __toString()
50 {
51 return isset($this->xml) ? (string)$this->xml->saveXML() : self::EMPTY_VALUE;
52 }
53 }
eZ\Publish\API\Repository\Values\Content\Query\Criterion\Value
Struct that stores extra value information for a Criterion object.
Definition: API/Repository/Values/Content/Query/Criterion/Value.php:13
eZ\Publish\Core\FieldType\RichText\Value\$xml
$xml
Definition: Core/FieldType/RichText/Value.php:29
eZ\Publish\Core\FieldType\RichText\Value\EMPTY_VALUE
const EMPTY_VALUE
Definition: Core/FieldType/RichText/Value.php:19
eZ\Publish\Core\FieldType\RichText\Value\__toString
__toString()
Definition: Core/FieldType/RichText/Value.php:49
eZ\Publish\Core\FieldType\RichText\Value\__construct
__construct($xml=null)
Initializes a new RichText Value object with $xmlDoc in.
Definition: Core/FieldType/RichText/Value.php:36
eZ\Publish\Core\FieldType\Value
Abstract class for all field value classes.
Definition: Core/FieldType/Value.php:17
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.