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

Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
eZ\Publish\Core\FieldType\RichText\Type Class Reference

RichText field type. More...

Inheritance diagram for eZ\Publish\Core\FieldType\RichText\Type:

## Public Member Functions
| __construct (Validator $internalFormatValidator, ConverterDispatcher $inputConverterDispatcher, Normalizer $inputNormalizer=null, ValidatorDispatcher $inputValidatorDispatcher=null, InternalLinkValidator $internalLinkValidator=null, CustomTagsValidator $customTagsValidator=null)
| getFieldTypeIdentifier ()
| Returns the field type identifier for this field type. More...
| getName (SPIValue $value)
| Returns the name of the given field value. More...
| getEmptyValue ()
| Returns the fallback default value of field type when no such default value is provided in the field definition in content types. More...
| isEmptyValue (SPIValue $value)
| Returns if the given $value is considered empty by the field type. More...
| validate (FieldDefinition $fieldDefinition, SPIValue $value)
| Validates a field based on the validators in the field definition. More...
| fromHash ($hash)
| Converts an $hash to the Value defined by the field type. More...
| toHash (SPIValue $value)
| Converts a $Value to a hash. More...
| fromPersistenceValue (FieldValue $fieldValue)
| Creates a new Value object from persistence data. More...
| toPersistenceValue (SPIValue $value)
| isSearchable ()
| Returns whether the field type is searchable. More...
Public Member Functions inherited from eZ\Publish\Core\FieldType\FieldType
| setTransformationProcessor (TransformationProcessor $transformationProcessor)
| getSettingsSchema ()
| Returns a schema for the settings expected by the FieldType. More...
| getValidatorConfigurationSchema ()
| Returns a schema for the validator configuration expected by the FieldType. More...
| validateValidatorConfiguration ($validatorConfiguration)
| Validates the validatorConfiguration of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct. More...
| applyDefaultValidatorConfiguration (&$validatorConfiguration)
| Applies the default values to the given $validatorConfiguration of a FieldDefinitionCreateStruct. More...
| validateFieldSettings ($fieldSettings)
| Validates the fieldSettings of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct. More...
| applyDefaultSettings (&$fieldSettings)
| Applies the default values to the fieldSettings of a FieldDefinitionCreateStruct. More...
| fromPersistenceValue (PersistenceValue $fieldValue)
| Converts a persistence $fieldValue to a Value. More...
| isSingular ()
| Indicates if the field definition of this type can appear only once in the same ContentType. More...
| onlyEmptyInstance ()
| Indicates if the field definition of this type can be added to a ContentType with Content instances. More...
| acceptValue ($inputValue)
| Potentially builds and checks the type and structure of the $inputValue. More...
| fieldSettingsToHash ($fieldSettings)
| Converts the given $fieldSettings to a simple hash format. More...
| fieldSettingsFromHash ($fieldSettingsHash)
| Converts the given $fieldSettingsHash to field settings of the type. More...
| validatorConfigurationToHash ($validatorConfiguration)
| Converts the given $validatorConfiguration to a simple hash format. More...
| validatorConfigurationFromHash ($validatorConfigurationHash)
| Converts the given $validatorConfigurationHash to a validator configuration of the type. More...
| getRelations (SPIValue $fieldValue)
| Returns relation data extracted from value. More...
| valuesEqual (SPIValue $value1, SPIValue $value2)
Public Member Functions inherited from eZ\Publish\SPI\FieldType\FieldType
| getName (Value $value)
| Returns a human readable string representation from the given $value. More...
| validate (FieldDefinition $fieldDef, Value $value)
| Validates a field based on the validator configuration in the field definition. More...
| isEmptyValue (Value $value)
| Returns if the given $value is considered empty by the field type. More...
| toHash (Value $value)
| Converts the given $value into a plain hash format. More...
| toPersistenceValue (Value $value)
| Converts a $value to a persistence value. More...
| getRelations (Value $value)
| Returns relation data extracted from value. More...
Public Member Functions inherited from eZ\Publish\SPI\FieldType\Comparable
| valuesEqual (Value $value1, Value $value2)

## Protected Member Functions
| createValueFromInput ($inputValue)
| Inspects given $inputValue and potentially converts it into a dedicated value object. More...
| loadXMLString ($xmlString)
| Creates \DOMDocument from given $xmlString. More...
| checkValueStructure (BaseValue $value)
| Throws an exception if value structure is not of expected format. More...
| getSortInfo (BaseValue $value)
| Returns information for FieldValue->$sortKey relevant to the field type. More...
Protected Member Functions inherited from eZ\Publish\Core\FieldType\FieldType
| getSortInfo (Value $value)
| Returns information for FieldValue->$sortKey relevant to the field type. More...
| checkValueStructure (Value $value)
| Throws an exception if value structure is not of expected format. More...

## Protected Attributes
| $internalFormatValidator
| $inputConverterDispatcher
| $inputNormalizer
| $inputValidatorDispatcher
| $internalLinkValidator
Protected Attributes inherited from eZ\Publish\Core\FieldType\FieldType
| $settingsSchema = []
| $validatorConfigurationSchema = []
| $transformationProcessor

## Private Attributes
| $customTagsValidator

## Additional Inherited Members
Static Protected Member Functions inherited from eZ\Publish\Core\FieldType\FieldType
static | checkValueType ($value)
| Throws an exception if the given $value is not an instance of the supported value subtype. More...

## Detailed Description

RichText field type.

Deprecated:
  since 7.4, use \EzSystems\EzPlatformRichText\eZ\FieldType\RichText\Type from EzPlatformRichTextBundle.

Definition at line 26 of file Core/FieldType/RichText/Type.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\FieldType\RichText\Type::__construct | ( | Validator | $internalFormatValidator,
|  | ConverterDispatcher | $inputConverterDispatcher,
|  | Normalizer | $inputNormalizer = `null`,
|  | ValidatorDispatcher | $inputValidatorDispatcher = `null`,
|  | InternalLinkValidator | $internalLinkValidator = `null`,
|  | CustomTagsValidator | $customTagsValidator = `null`
| ) |  |

Parameters

  \eZ\Publish\Core\FieldType\RichText\Validator | $internalFormatValidator |
  \eZ\Publish\Core\FieldType\RichText\ConverterDispatcher | $inputConverterDispatcher |
  \eZ\Publish\Core\FieldType\RichText\Normalizer | null | $inputNormalizer |
  \eZ\Publish\Core\FieldType\RichText\ValidatorDispatcher | null | $inputValidatorDispatcher |
  \eZ\Publish\Core\FieldType\RichText\InternalLinkValidator | null | $internalLinkValidator |
  \eZ\Publish\Core\FieldType\RichText\CustomTagsValidator | null | $customTagsValidator |

Definition at line 54 of file Core/FieldType/RichText/Type.php.

References eZ\Publish\Core\FieldType\RichText\Type\$customTagsValidator, eZ\Publish\Core\FieldType\RichText\Type\$inputConverterDispatcher, eZ\Publish\Core\FieldType\RichText\Type\$inputNormalizer, eZ\Publish\Core\FieldType\RichText\Type\$inputValidatorDispatcher, eZ\Publish\Core\FieldType\RichText\Type\$internalFormatValidator, and eZ\Publish\Core\FieldType\RichText\Type\$internalLinkValidator.

## Member Function Documentation

## ◆ checkValueStructure()

eZ\Publish\Core\FieldType\RichText\Type::checkValueStructure | ( | BaseValue | $value | ) |
| protected

Throws an exception if value structure is not of expected format.

Exceptions

Definition at line 230 of file Core/FieldType/RichText/Type.php.

## ◆ createValueFromInput()

eZ\Publish\Core\FieldType\RichText\Type::createValueFromInput | ( |  | $inputValue | ) |
| protected

Inspects given $inputValue and potentially converts it into a dedicated value object.

Parameters

  \eZ\Publish\Core\FieldType\RichText\Value | \DOMDocument | string | $inputValue |

Returns
  \eZ\Publish\Core\FieldType\RichText\Value The potentially converted and structurally plausible value.

Reimplemented from eZ\Publish\Core\FieldType\FieldType.

Definition at line 152 of file Core/FieldType/RichText/Type.php.

References eZ\Publish\Core\FieldType\RichText\Type\loadXMLString().

## ◆ fromHash()

eZ\Publish\Core\FieldType\RichText\Type::fromHash | ( |  | $hash | ) |

Converts an $hash to the Value defined by the field type.

$hash accepts the following keys:

- xml (XML string which complies internal format).

Parameters

  mixed | $hash |

Returns
  \eZ\Publish\Core\FieldType\RichText\Value $value

Implements eZ\Publish\SPI\FieldType\FieldType.

Definition at line 305 of file Core/FieldType/RichText/Type.php.

References eZ\Publish\Core\FieldType\FieldType\acceptValue().

## ◆ fromPersistenceValue()

eZ\Publish\Core\FieldType\RichText\Type::fromPersistenceValue | ( | FieldValue | $fieldValue | ) |

Creates a new Value object from persistence data.

$fieldValue->data is supposed to be a string.

Parameters

  \eZ\Publish\SPI\Persistence\Content\FieldValue | $fieldValue |

Returns
  \eZ\Publish\Core\FieldType\RichText\Value

Implements eZ\Publish\SPI\FieldType\FieldType.

Definition at line 334 of file Core/FieldType/RichText/Type.php.

## ◆ getEmptyValue()

eZ\Publish\Core\FieldType\RichText\Type::getEmptyValue | ( |  | ) |

Returns the fallback default value of field type when no such default value is provided in the field definition in content types.

Returns
  \eZ\Publish\Core\FieldType\RichText\Value

Implements eZ\Publish\SPI\FieldType\FieldType.

Definition at line 124 of file Core/FieldType/RichText/Type.php.

## ◆ getFieldTypeIdentifier()

eZ\Publish\Core\FieldType\RichText\Type::getFieldTypeIdentifier | ( |  | ) |

Returns the field type identifier for this field type.

Returns
  string

Implements eZ\Publish\SPI\FieldType\FieldType.

Definition at line 83 of file Core/FieldType/RichText/Type.php.

## ◆ getName()

eZ\Publish\Core\FieldType\RichText\Type::getName | ( | SPIValue | $value | ) |

Returns the name of the given field value.

It will be used to generate content name and url alias if current field is designated to be used in the content name/urlAlias pattern.

Parameters

  \eZ\Publish\Core\FieldType\RichText\Value | $value |

Returns
  string

Definition at line 98 of file Core/FieldType/RichText/Type.php.

## ◆ getSortInfo()

eZ\Publish\Core\FieldType\RichText\Type::getSortInfo | ( | BaseValue | $value | ) |
| protected

Returns information for FieldValue->$sortKey relevant to the field type.

Parameters

  \eZ\Publish\Core\FieldType\RichText\Value | $value |

Returns
  string|null

Definition at line 291 of file Core/FieldType/RichText/Type.php.

References eZ\Publish\Core\FieldType\RichText\SearchField\extractShortText().

## ◆ isEmptyValue()

eZ\Publish\Core\FieldType\RichText\Type::isEmptyValue | ( | SPIValue | $value | ) |

Returns if the given $value is considered empty by the field type.

Parameters

  \eZ\Publish\Core\FieldType\RichText\Value | $value |

Returns
  bool

Reimplemented from eZ\Publish\Core\FieldType\FieldType.

Definition at line 136 of file Core/FieldType/RichText/Type.php.

## ◆ isSearchable()

eZ\Publish\Core\FieldType\RichText\Type::isSearchable | ( |  | ) |

Returns whether the field type is searchable.

Returns
  bool

Reimplemented from eZ\Publish\Core\FieldType\FieldType.

Definition at line 360 of file Core/FieldType/RichText/Type.php.

## ◆ loadXMLString()

eZ\Publish\Core\FieldType\RichText\Type::loadXMLString | ( |  | $xmlString | ) |
| protected

Creates \DOMDocument from given $xmlString.

Exceptions

Definition at line 194 of file Core/FieldType/RichText/Type.php.

Referenced by eZ\Publish\Core\FieldType\RichText\Type\createValueFromInput().

## ◆ toHash()

eZ\Publish\Core\FieldType\RichText\Type::toHash | ( | SPIValue | $value | ) |

Converts a $Value to a hash.

Parameters

  \eZ\Publish\Core\FieldType\RichText\Value | $value |

Returns
  mixed

Definition at line 321 of file Core/FieldType/RichText/Type.php.

## ◆ toPersistenceValue()

eZ\Publish\Core\FieldType\RichText\Type::toPersistenceValue | ( | SPIValue | $value | ) |

Parameters

  \eZ\Publish\Core\FieldType\RichText\Value | $value |

Returns
  \eZ\Publish\SPI\Persistence\Content\FieldValue

Reimplemented from eZ\Publish\Core\FieldType\FieldType.

Definition at line 344 of file Core/FieldType/RichText/Type.php.

## ◆ validate()

eZ\Publish\Core\FieldType\RichText\Type::validate | ( | FieldDefinition | $fieldDefinition,
|  | SPIValue | $value
| ) |  |

Validates a field based on the validators in the field definition.

This is a base implementation, returning an empty array() that indicates that no validation errors occurred. Overwrite in derived types, if validation is supported.

Exceptions

Reimplemented from eZ\Publish\Core\FieldType\FieldType.

Definition at line 255 of file Core/FieldType/RichText/Type.php.

## Member Data Documentation

## ◆ $customTagsValidator

eZ\Publish\Core\FieldType\RichText\Type::$customTagsValidator
| private

Definition at line 44 of file Core/FieldType/RichText/Type.php.

Referenced by eZ\Publish\Core\FieldType\RichText\Type\__construct().

## ◆ $inputConverterDispatcher

eZ\Publish\Core\FieldType\RichText\Type::$inputConverterDispatcher
| protected

Definition at line 32 of file Core/FieldType/RichText/Type.php.

Referenced by eZ\Publish\Core\FieldType\RichText\Type\__construct().

## ◆ $inputNormalizer

eZ\Publish\Core\FieldType\RichText\Type::$inputNormalizer
| protected

Definition at line 35 of file Core/FieldType/RichText/Type.php.

Referenced by eZ\Publish\Core\FieldType\RichText\Type\__construct().

## ◆ $inputValidatorDispatcher

eZ\Publish\Core\FieldType\RichText\Type::$inputValidatorDispatcher
| protected

Definition at line 38 of file Core/FieldType/RichText/Type.php.

Referenced by eZ\Publish\Core\FieldType\RichText\Type\__construct().

## ◆ $internalFormatValidator

eZ\Publish\Core\FieldType\RichText\Type::$internalFormatValidator
| protected

Definition at line 29 of file Core/FieldType/RichText/Type.php.

Referenced by eZ\Publish\Core\FieldType\RichText\Type\__construct().

## ◆ $internalLinkValidator

eZ\Publish\Core\FieldType\RichText\Type::$internalLinkValidator
| protected

Definition at line 41 of file Core/FieldType/RichText/Type.php.

Referenced by eZ\Publish\Core\FieldType\RichText\Type\__construct().

The documentation for this class was generated from the following file:

- Core/FieldType/RichText/Type.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.