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

Inheritance: extends eZ\Publish\Core\FieldType\FieldType
Show file Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Property 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

Public Methods

Method 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.

Protected Methods

Method 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 method

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

checkValueStructure() protected method

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

createValueFromInput() protected method

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

fromHash() public method

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

fromPersistenceValue() public method

$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
return Value

getEmptyValue() public method

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
return Value

getFieldTypeIdentifier() public method

Returns the field type identifier for this field type.
public getFieldTypeIdentifier ( ) : string
return string

getName() public method

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
return string

getRelatedObjectIds() protected method

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

getRelations() public method

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
return 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 method

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

isEmptyValue() public method

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
return boolean

isSearchable() public method

Returns whether the field type is searchable.
public isSearchable ( ) : boolean
return boolean

loadXMLString() protected method

Creates \DOMDocument from given $xmlString.
protected loadXMLString ( $xmlString ) : DOMDocument
$xmlString
return DOMDocument

toHash() public method

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

toPersistenceValue() public method

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

validate() public method

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
return eZ\Publish\SPI\FieldType\ValidationError[]

validateFieldSettings() public method

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

Property Details

$inputConverterDispatcher protected property

protected ConverterDispatcher,eZ\Publish\Core\FieldType\RichText $inputConverterDispatcher
return ConverterDispatcher

$inputNormalizer protected property

protected Normalizer,eZ\Publish\Core\FieldType\RichText $inputNormalizer
return Normalizer

$inputValidatorDispatcher protected property

protected null|ValidatorDispatcher,eZ\Publish\Core\FieldType\RichText $inputValidatorDispatcher
return null | ValidatorDispatcher

$internalFormatValidator protected property

protected ValidatorDispatcher,eZ\Publish\Core\FieldType\RichText $internalFormatValidator
return ValidatorDispatcher

$settingsSchema protected property

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