PHP Class eZ\Publish\Core\REST\Client\FieldType

Inheritance: implements eZ\Publish\API\Repository\FieldType
Afficher le fichier Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Свойство Type Description
$innerFieldType eZ\Publish\API\Repository\FieldType Wrapped FieldType.

Méthodes publiques

Méthode Description
__construct ( eZ\Publish\SPI\FieldType\FieldType $innerFieldType )
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.

Method Details

__construct() public méthode

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

fieldSettingsFromHash() public méthode

This is the reverse operation of {@link fieldSettingsToHash()}.
public fieldSettingsFromHash ( array | hash | scalar | null $fieldSettingsHash ) : mixed
$fieldSettingsHash array | hash | scalar | null
Résultat mixed

fieldSettingsToHash() public méthode

Converts the given $fieldSettings to a simple hash format.
public fieldSettingsToHash ( mixed $fieldSettings ) : array | hash | scalar | null
$fieldSettings mixed
Résultat array | hash | scalar | null

fromHash() public méthode

Converts an $hash to the Value defined by the field type.
public fromHash ( mixed $hash ) : mixed
$hash mixed
Résultat mixed

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 ( ) : mixed
Résultat mixed

getFieldTypeIdentifier() public méthode

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

getName() public méthode

public getName ( $value )

getSettingsSchema() public méthode

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 implementor 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
Résultat mixed

getValidatorConfigurationSchema() public méthode

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 implementor 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, ) ), );

isEmptyValue() public méthode

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
Résultat boolean

isSearchable() public méthode

Indicates if the field type supports indexing and sort keys for searching.
public isSearchable ( ) : boolean
Résultat boolean

isSingular() public méthode

Indicates if the field definition of this type can appear only once in the same ContentType.
public isSingular ( ) : boolean
Résultat boolean

onlyEmptyInstance() public méthode

Indicates if the field definition of this type can be added to a ContentType with Content instances.
public onlyEmptyInstance ( ) : boolean
Résultat boolean

toHash() public méthode

Converts a Value to a hash.
public toHash ( mixed $value ) : mixed
$value mixed
Résultat mixed

validateFieldSettings() public méthode

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

validateValidatorConfiguration() public méthode

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

validateValue() public méthode

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

validatorConfigurationFromHash() public méthode

Converts the given $validatorConfigurationHash to a validator configuration of the type.
public validatorConfigurationFromHash ( array | hash | scalar | null $validatorConfigurationHash ) : mixed
$validatorConfigurationHash array | hash | scalar | null
Résultat mixed

validatorConfigurationToHash() public méthode

Converts the given $validatorConfiguration to a simple hash format.
public validatorConfigurationToHash ( mixed $validatorConfiguration ) : array | hash | scalar | null
$validatorConfiguration mixed
Résultat array | hash | scalar | null

Property Details

$innerFieldType protected_oe property

Wrapped FieldType.
protected FieldType,eZ\Publish\API\Repository $innerFieldType
Résultat eZ\Publish\API\Repository\FieldType