PHP Class eZ\Publish\Core\FieldType\RichText\Type

Inheritance: extends eZ\Publish\Core\FieldType\FieldType
Afficher le fichier Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Свойство Type Description
$inputConverterDispatcher ConverterDispatcher
$inputNormalizer Normalizer
$inputValidatorDispatcher null | ValidatorDispatcher
$internalFormatValidator ValidatorDispatcher
$settingsSchema array The key is the setting name, and the value is the default value for this setting

Méthodes publiques

Méthode Description
__construct ( Validator $internalFormatValidator, ConverterDispatcher $inputConverterDispatcher, Normalizer $inputNormalizer = null, ValidatorDispatcher $inputValidatorDispatcher = null )
fromHash ( mixed $hash ) : Value Converts an $hash to the Value defined by the field type.
fromPersistenceValue ( eZ\Publish\SPI\Persistence\Content\FieldValue $fieldValue ) : Value Creates a new Value object from persistence data.
getEmptyValue ( ) : Value Returns the fallback default value of field type when no such default value is provided in the field definition in content types.
getFieldTypeIdentifier ( ) : string Returns the field type identifier for this field type.
getName ( eZ\Publish\SPI\FieldType\Value $value ) : string Returns the name of the given field value.
getRelations ( eZ\Publish\SPI\FieldType\Value $value ) : array Returns relation data extracted from value.
isEmptyValue ( eZ\Publish\SPI\FieldType\Value $value ) : boolean Returns if the given $value is considered empty by the field type.
isSearchable ( ) : boolean Returns whether the field type is searchable.
toHash ( eZ\Publish\SPI\FieldType\Value $value ) : mixed Converts a $Value to a hash.
toPersistenceValue ( eZ\Publish\SPI\FieldType\Value $value ) : eZ\Publish\SPI\Persistence\Content\FieldValue
validate ( eZ\Publish\API\Repository\Values\ContentType\FieldDefinition $fieldDefinition, eZ\Publish\SPI\FieldType\Value $value ) : eZ\Publish\SPI\FieldType\ValidationError[] Validates a field based on the validators in the field definition.
validateFieldSettings ( mixed $fieldSettings ) : eZ\Publish\SPI\FieldType\ValidationError[] Validates the fieldSettings of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct.

Méthodes protégées

Méthode Description
checkValueStructure ( Value $value ) Throws an exception if value structure is not of expected format.
createValueFromInput ( Value | DOMDocument | string $inputValue ) : Value Inspects given $inputValue and potentially converts it into a dedicated value object.
getRelatedObjectIds ( Value $fieldValue, $relationType )
getSortInfo ( Value $value ) : array | boolean Returns sortKey information.
loadXMLString ( $xmlString ) : DOMDocument Creates \DOMDocument from given $xmlString.

Method Details

__construct() public méthode

public __construct ( Validator $internalFormatValidator, ConverterDispatcher $inputConverterDispatcher, Normalizer $inputNormalizer = null, ValidatorDispatcher $inputValidatorDispatcher = null )
$internalFormatValidator Validator
$inputConverterDispatcher ConverterDispatcher
$inputNormalizer Normalizer
$inputValidatorDispatcher ValidatorDispatcher

checkValueStructure() protected méthode

Throws an exception if value structure is not of expected format.
protected checkValueStructure ( Value $value )
$value eZ\Publish\Core\FieldType\Value

createValueFromInput() protected méthode

Inspects given $inputValue and potentially converts it into a dedicated value object.
protected createValueFromInput ( Value | DOMDocument | string $inputValue ) : Value
$inputValue Value | DOMDocument | string
Résultat Value The potentially converted and structurally plausible value.

fromHash() public méthode

$hash accepts the following keys: - xml (XML string which complies internal format).
public fromHash ( mixed $hash ) : Value
$hash mixed
Résultat Value $value

fromPersistenceValue() public méthode

$fieldValue->data is supposed to be a string.
public fromPersistenceValue ( eZ\Publish\SPI\Persistence\Content\FieldValue $fieldValue ) : Value
$fieldValue eZ\Publish\SPI\Persistence\Content\FieldValue
Résultat Value

getEmptyValue() public méthode

Returns the fallback default value of field type when no such default value is provided in the field definition in content types.
public getEmptyValue ( ) : Value
Résultat Value

getFieldTypeIdentifier() public méthode

Returns the field type identifier for this field type.
public getFieldTypeIdentifier ( ) : string
Résultat string

getName() public méthode

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.
public getName ( eZ\Publish\SPI\FieldType\Value $value ) : string
$value eZ\Publish\SPI\FieldType\Value
Résultat string

getRelatedObjectIds() protected méthode

protected getRelatedObjectIds ( Value $fieldValue, $relationType )
$fieldValue Value

getRelations() public méthode

Not intended for \eZ\Publish\API\Repository\Values\Content\Relation::COMMON type relations, there is a service API for handling those.
public getRelations ( eZ\Publish\SPI\FieldType\Value $value ) : array
$value eZ\Publish\SPI\FieldType\Value
Résultat array Hash with relation type as key and array of destination content ids as value. Example: array( \eZ\Publish\API\Repository\Values\Content\Relation::LINK => array( "contentIds" => array( 12, 13, 14 ), "locationIds" => array( 24 ) ), \eZ\Publish\API\Repository\Values\Content\Relation::EMBED => array( "contentIds" => array( 12 ), "locationIds" => array( 24, 45 ) ), \eZ\Publish\API\Repository\Values\Content\Relation::ATTRIBUTE => array( 12 ) )

getSortInfo() protected méthode

Returns sortKey information.
See also: eZ\Publish\Core\FieldType
protected getSortInfo ( Value $value ) : array | boolean
$value eZ\Publish\Core\FieldType\Value
Résultat array | boolean

isEmptyValue() public méthode

Returns if the given $value is considered empty by the field type.
public isEmptyValue ( eZ\Publish\SPI\FieldType\Value $value ) : boolean
$value eZ\Publish\SPI\FieldType\Value
Résultat boolean

isSearchable() public méthode

Returns whether the field type is searchable.
public isSearchable ( ) : boolean
Résultat boolean

loadXMLString() protected méthode

Creates \DOMDocument from given $xmlString.
protected loadXMLString ( $xmlString ) : DOMDocument
$xmlString
Résultat DOMDocument

toHash() public méthode

Converts a $Value to a hash.
public toHash ( eZ\Publish\SPI\FieldType\Value $value ) : mixed
$value eZ\Publish\SPI\FieldType\Value
Résultat mixed

toPersistenceValue() public méthode

public toPersistenceValue ( eZ\Publish\SPI\FieldType\Value $value ) : eZ\Publish\SPI\Persistence\Content\FieldValue
$value eZ\Publish\SPI\FieldType\Value
Résultat eZ\Publish\SPI\Persistence\Content\FieldValue

validate() public méthode

This is a base implementation, returning an empty array() that indicates that no validation errors occurred. Overwrite in derived types, if validation is supported.
public validate ( eZ\Publish\API\Repository\Values\ContentType\FieldDefinition $fieldDefinition, eZ\Publish\SPI\FieldType\Value $value ) : eZ\Publish\SPI\FieldType\ValidationError[]
$fieldDefinition eZ\Publish\API\Repository\Values\ContentType\FieldDefinition The field definition of the field
$value eZ\Publish\SPI\FieldType\Value The field value for which an action is performed
Résultat eZ\Publish\SPI\FieldType\ValidationError[]

validateFieldSettings() public méthode

Validates the fieldSettings of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct.
public validateFieldSettings ( mixed $fieldSettings ) : eZ\Publish\SPI\FieldType\ValidationError[]
$fieldSettings mixed
Résultat eZ\Publish\SPI\FieldType\ValidationError[]

Property Details

$inputConverterDispatcher protected_oe property

protected ConverterDispatcher,eZ\Publish\Core\FieldType\RichText $inputConverterDispatcher
Résultat ConverterDispatcher

$inputNormalizer protected_oe property

protected Normalizer,eZ\Publish\Core\FieldType\RichText $inputNormalizer
Résultat Normalizer

$inputValidatorDispatcher protected_oe property

protected null|ValidatorDispatcher,eZ\Publish\Core\FieldType\RichText $inputValidatorDispatcher
Résultat null | ValidatorDispatcher

$internalFormatValidator protected_oe property

protected ValidatorDispatcher,eZ\Publish\Core\FieldType\RichText $internalFormatValidator
Résultat ValidatorDispatcher

$settingsSchema protected_oe property

The key is the setting name, and the value is the default value for this setting
protected array $settingsSchema
Résultat array