PHP Класс eZ\Publish\Core\Repository\Values\ContentType\FieldType

См. также: eZ\Publish\API\Repository\FieldType
Наследование: implements eZ\Publish\API\Repository\FieldType
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$internalFieldType eZ\Publish\Core\FieldType\FieldType Holds internal FieldType object.

Открытые методы

Метод Описание
__construct ( eZ\Publish\SPI\FieldType\FieldType $fieldType )
fieldSettingsFromHash ( array | hash | scalar | null $fieldSettingsHash ) : mixed Converts the given $fieldSettingsHash to field settings of the type.
fieldSettingsToHash ( mixed $fieldSettings ) : array | hash | scalar | null Converts the given $fieldSettings to a simple hash format.
fromHash ( mixed $hash ) : mixed Converts an $hash to the Value defined by the field type.
getEmptyValue ( ) : mixed 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 ( $value )
getSettingsSchema ( ) : mixed Returns a schema for the settings expected by the FieldType.
getValidatorConfigurationSchema ( ) : mixed Returns a schema for the validator configuration expected by the FieldType.
isEmptyValue ( mixed $value ) : boolean Returns if the given $value is considered empty by the field type.
isSearchable ( ) : boolean Indicates if the field type supports indexing and sort keys for searching.
isSingular ( ) : boolean Indicates if the field definition of this type can appear only once in the same ContentType.
onlyEmptyInstance ( ) : boolean Indicates if the field definition of this type can be added to a ContentType with Content instances.
toHash ( mixed $value ) : mixed Converts a Value to a hash.
validateFieldSettings ( mixed $fieldSettings ) : eZ\Publish\SPI\FieldType\ValidationError[] Validates the fieldSettings of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct.
validateValidatorConfiguration ( mixed $validatorConfiguration ) : eZ\Publish\SPI\FieldType\ValidationError[] Validates the validatorConfiguration of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct.
validateValue ( eZ\Publish\API\Repository\Values\ContentType\FieldDefinition $fieldDef, eZ\Publish\SPI\FieldType\Value $value ) : eZ\Publish\SPI\FieldType\ValidationError[] Validates a field value based on the validator configuration in the field definition.
validatorConfigurationFromHash ( array | hash | scalar | null $validatorConfigurationHash ) : mixed Converts the given $validatorConfigurationHash to a validator configuration of the type.
validatorConfigurationToHash ( mixed $validatorConfiguration ) : array | hash | scalar | null Converts the given $validatorConfiguration to a simple hash format.

Описание методов

__construct() публичный Метод

public __construct ( eZ\Publish\SPI\FieldType\FieldType $fieldType )
$fieldType eZ\Publish\SPI\FieldType\FieldType

fieldSettingsFromHash() публичный Метод

This is the reverse operation of {@link fieldSettingsToHash()}.
public fieldSettingsFromHash ( array | hash | scalar | null $fieldSettingsHash ) : mixed
$fieldSettingsHash array | hash | scalar | null
Результат mixed

fieldSettingsToHash() публичный Метод

Converts the given $fieldSettings to a simple hash format.
public fieldSettingsToHash ( mixed $fieldSettings ) : array | hash | scalar | null
$fieldSettings mixed
Результат array | hash | scalar | null

fromHash() публичный Метод

Converts an $hash to the Value defined by the field type.
public fromHash ( mixed $hash ) : mixed
$hash mixed
Результат mixed

getEmptyValue() публичный Метод

Returns the fallback default value of field type when no such default value is provided in the field definition in content types.
public getEmptyValue ( ) : mixed
Результат mixed

getFieldTypeIdentifier() публичный Метод

Returns the field type identifier for this field type.
public getFieldTypeIdentifier ( ) : string
Результат string

getName() публичный Метод

public getName ( $value )

getSettingsSchema() публичный Метод

Returns an arbitrary value, representing a schema for the settings of the FieldType. Explanation: There are no possible generic schemas for defining settings input, which is why no schema for the return value of this method is defined. It is up to the implementer to define and document a schema for the return value and document it. In addition, it is necessary that all consumers of this interface (e.g. Public API, REST API, GUIs, ...) provide plugin mechanisms to hook adapters for the specific FieldType into. These adapters then need to be either shipped with the FieldType or need to be implemented by a third party. If there is no adapter available for a specific FieldType, it will not be usable with the consumer.
public getSettingsSchema ( ) : mixed
Результат mixed

getValidatorConfigurationSchema() публичный Метод

Returns an arbitrary value, representing a schema for the validator configuration of the FieldType. Explanation: There are no possible generic schemas for defining settings input, which is why no schema for the return value of this method is defined. It is up to the implementer to define and document a schema for the return value and document it. In addition, it is necessary that all consumers of this interface (e.g. Public API, REST API, GUIs, ...) provide plugin mechanisms to hook adapters for the specific FieldType into. These adapters then need to be either shipped with the FieldType or need to be implemented by a third party. If there is no adapter available for a specific FieldType, it will not be usable with the consumer. Best practice: It is considered best practice to return a hash map, which contains rudimentary settings structures, like e.g. for the "ezstring" FieldType array( 'stringLength' => array( 'minStringLength' => array( 'type' => 'int', 'default' => 0, ), 'maxStringLength' => array( 'type' => 'int' 'default' => null, ) ), );
public getValidatorConfigurationSchema ( ) : mixed
Результат mixed

isEmptyValue() публичный Метод

Usually, only the value returned by {@link getEmptyValue()} is considered empty but that is not always the case. Note: This function assumes that $value is valid so this function can only be used reliably on $values that came from the API, not from the user.
public isEmptyValue ( mixed $value ) : boolean
$value mixed
Результат boolean

isSearchable() публичный Метод

Indicates if the field type supports indexing and sort keys for searching.
public isSearchable ( ) : boolean
Результат boolean

isSingular() публичный Метод

Indicates if the field definition of this type can appear only once in the same ContentType.
public isSingular ( ) : boolean
Результат boolean

onlyEmptyInstance() публичный Метод

Indicates if the field definition of this type can be added to a ContentType with Content instances.
public onlyEmptyInstance ( ) : boolean
Результат boolean

toHash() публичный Метод

Converts a Value to a hash.
public toHash ( mixed $value ) : mixed
$value mixed
Результат mixed

validateFieldSettings() публичный Метод

This methods determines if the given $fieldSettings are structurally correct and comply to the settings schema as defined in FieldType.
public validateFieldSettings ( mixed $fieldSettings ) : eZ\Publish\SPI\FieldType\ValidationError[]
$fieldSettings mixed
Результат eZ\Publish\SPI\FieldType\ValidationError[]

validateValidatorConfiguration() публичный Метод

This methods determines if the given $validatorConfiguration is structurally correct and complies to the validator configuration schema as defined in FieldType.
public validateValidatorConfiguration ( mixed $validatorConfiguration ) : eZ\Publish\SPI\FieldType\ValidationError[]
$validatorConfiguration mixed
Результат eZ\Publish\SPI\FieldType\ValidationError[]

validateValue() публичный Метод

Validates a field value based on the validator configuration in the field definition.
public validateValue ( eZ\Publish\API\Repository\Values\ContentType\FieldDefinition $fieldDef, eZ\Publish\SPI\FieldType\Value $value ) : eZ\Publish\SPI\FieldType\ValidationError[]
$fieldDef 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
Результат eZ\Publish\SPI\FieldType\ValidationError[]

validatorConfigurationFromHash() публичный Метод

Converts the given $validatorConfigurationHash to a validator configuration of the type.
public validatorConfigurationFromHash ( array | hash | scalar | null $validatorConfigurationHash ) : mixed
$validatorConfigurationHash array | hash | scalar | null
Результат mixed

validatorConfigurationToHash() публичный Метод

Converts the given $validatorConfiguration to a simple hash format.
public validatorConfigurationToHash ( mixed $validatorConfiguration ) : array | hash | scalar | null
$validatorConfiguration mixed
Результат array | hash | scalar | null

Описание свойств

$internalFieldType защищенное свойство

Holds internal FieldType object.
protected FieldType,eZ\Publish\Core\FieldType $internalFieldType
Результат eZ\Publish\Core\FieldType\FieldType