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

RichTextConverter.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter;
8
9 use eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter;
10 use eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldValue;
11 use eZ\Publish\SPI\Persistence\Content\FieldValue;
12 use eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition;
13 use eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldDefinition;
14 use eZ\Publish\Core\FieldType\RichText\Value;
15
16 class RichTextConverter implements Converter
17 {
27 public static function create()
28 {
29 return new self();
30 }
31
38 public function toStorageValue(FieldValue $value, StorageFieldValue $storageFieldValue)
39 {
40 $storageFieldValue->dataText = $value->data;
41 $storageFieldValue->sortKeyString = $value->sortKey;
42 }
43
50 public function toFieldValue(StorageFieldValue $value, FieldValue $fieldValue)
51 {
52 $fieldValue->data = $value->dataText ?: Value::EMPTY_VALUE;
53 $fieldValue->sortKey = $value->sortKeyString;
54 }
55
62 public function toStorageFieldDefinition(FieldDefinition $fieldDefinition, StorageFieldDefinition $storageDefinition)
63 {
64 // Nothing to store
65 }
66
73 public function toFieldDefinition(StorageFieldDefinition $storageDefinition, FieldDefinition $fieldDefinition)
74 {
75 $fieldDefinition->defaultValue->data = Value::EMPTY_VALUE;
76 }
77
87 public function getIndexColumn()
88 {
89 return 'sort_key_string';
90 }
91 }
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\Persistence\Legacy\Content\FieldValue\Converter\RichTextConverter
Definition: RichTextConverter.php:17
eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter\RichTextConverter\toStorageFieldDefinition
toStorageFieldDefinition(FieldDefinition $fieldDefinition, StorageFieldDefinition $storageDefinition)
Converts field definition data from $fieldDefinition into $storageFieldDefinition.
Definition: RichTextConverter.php:62
eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter\RichTextConverter\toStorageValue
toStorageValue(FieldValue $value, StorageFieldValue $storageFieldValue)
Converts data from $value to $storageFieldValue.
Definition: RichTextConverter.php:38
eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter\RichTextConverter\toFieldDefinition
toFieldDefinition(StorageFieldDefinition $storageDefinition, FieldDefinition $fieldDefinition)
Converts field definition data from $storageDefinition into $fieldDefinition.
Definition: RichTextConverter.php:73
eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter\RichTextConverter\create
static create()
Factory for current class.
Definition: RichTextConverter.php:27
eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter\RichTextConverter\toFieldValue
toFieldValue(StorageFieldValue $value, FieldValue $fieldValue)
Converts data from $value to $fieldValue.
Definition: RichTextConverter.php:50
eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter\RichTextConverter\getIndexColumn
getIndexColumn()
Returns the name of the index column in the attribute table.
Definition: RichTextConverter.php:87
eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldDefinition
Definition: StorageFieldDefinition.php:12
eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldValue
Definition: StorageFieldValue.php:12
eZ\Publish\SPI\Persistence\Content\FieldValue
Definition: FieldValue.php:12
eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition
Definition: SPI/Persistence/Content/Type/FieldDefinition.php:18
eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter
Converter for field values in legacy storage.
Definition: Persistence/Legacy/Content/FieldValue/Converter.php:18
eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter
Definition: AuthorConverter.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.