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

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

Base class for field types, the most basic storage unit of data inside eZ Publish. More...

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

## Public Member Functions
| 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...
| validate (FieldDefinition $fieldDefinition, SPIValue $value)
| Validates a field based on the validators in the field definition. 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...
| toPersistenceValue (SPIValue $value)
| Converts a $value to a persistence value. More...
| fromPersistenceValue (PersistenceValue $fieldValue)
| Converts a persistence $fieldValue to a Value. More...
| isSearchable ()
| Returns whether the field type is searchable. 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...
| isEmptyValue (SPIValue $value)
| Returns if the given $value is considered empty by the field type. 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
| getFieldTypeIdentifier ()
| Returns the field type identifier for this field type. More...
| 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...
| getEmptyValue ()
| Returns the empty value for this field type. More...
| isEmptyValue (Value $value)
| Returns if the given $value is considered empty by the field type. More...
| fromHash ($hash)
| Converts an $hash to the Value defined 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...
| fromPersistenceValue (FieldValue $fieldValue)
| Converts a persistence $value to a 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
| getSortInfo (Value $value)
| Returns information for FieldValue->$sortKey relevant to the field type. More...
| createValueFromInput ($inputValue)
| Inspects given $inputValue and potentially converts it into a dedicated value object. More...
| checkValueStructure (Value $value)
| Throws an exception if value structure is not of expected format. More...

## Static Protected Member Functions
static | checkValueType ($value)
| Throws an exception if the given $value is not an instance of the supported value subtype. More...

## Protected Attributes
| $settingsSchema = []
| $validatorConfigurationSchema = []
| $transformationProcessor

## Detailed Description

Base class for field types, the most basic storage unit of data inside eZ Publish.

All other field types extend FieldType providing the specific functionality desired in each case.

The capabilities supported by each individual field type is decided by which interfaces the field type implements support for. These individual capabilities can also be checked via the supports*() methods.

Field types are the base building blocks of Content Types, and serve as data containers for Content objects. Therefore, while field types can be used independently, they are designed to be used as a part of a Content object.

Field types are primed and pre-configured with the Field Definitions found in Content Types.

Definition at line 34 of file Core/FieldType/FieldType.php.

## Member Function Documentation

## ◆ acceptValue()

eZ\Publish\Core\FieldType\FieldType::acceptValue | ( |  | $inputValue | ) |
| final

Potentially builds and checks the type and structure of the $inputValue.

This method first inspects $inputValue and convert it into a dedicated value object.

After that, the value is checked for structural validity. Note that this does not include validation after the rules from validators, but only plausibility checks for the general data format.

Note that this method must also cope with the empty value for the field type as e.g. returned by getEmptyValue().

Exceptions

Implements eZ\Publish\SPI\FieldType\FieldType.

Definition at line 376 of file Core/FieldType/FieldType.php.

References eZ\Publish\Core\FieldType\FieldType\checkValueStructure(), eZ\Publish\Core\FieldType\FieldType\createValueFromInput(), eZ\Publish\SPI\FieldType\FieldType\getEmptyValue(), and eZ\Publish\Core\FieldType\FieldType\isEmptyValue().

Referenced by eZ\Publish\Core\FieldType\RichText\Type\fromHash(), and eZ\Publish\Core\FieldType\User\Type\fromPersistenceValue().

## ◆ applyDefaultSettings()

eZ\Publish\Core\FieldType\FieldType::applyDefaultSettings | ( | & | $fieldSettings | ) |

Applies the default values to the fieldSettings of a FieldDefinitionCreateStruct.

This is a base implementation, expecting best practice field settings format used by field types in standard eZ publish installation. Overwrite in derived types if needed.

Exceptions

Implements eZ\Publish\SPI\FieldType\FieldType.

Definition at line 239 of file Core/FieldType/FieldType.php.

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

## ◆ applyDefaultValidatorConfiguration()

eZ\Publish\Core\FieldType\FieldType::applyDefaultValidatorConfiguration | ( | & | $validatorConfiguration | ) |

Applies the default values to the given $validatorConfiguration of a FieldDefinitionCreateStruct.

This is a base implementation, expecting best practice validator configuration format used by field types in standard eZ publish installation. Overwrite in derived types if needed.

Exceptions

Implements eZ\Publish\SPI\FieldType\FieldType.

Definition at line 180 of file Core/FieldType/FieldType.php.

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

## ◆ checkValueStructure()

eZ\Publish\Core\FieldType\FieldType::checkValueStructure | ( | Value | $value | ) |
| abstract protected

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

Note that this does not include validation after the rules from validators, but only plausibility checks for the general data format.

This is an operation method for {

See also
  acceptValue()}.

Example implementation: `protected function checkValueStructure( Value $value ) { if ( !is_array( $value->cookies ) ) { throw new InvalidArgumentException( "An array of assorted cookies was expected." ); } }`

Exceptions

Referenced by eZ\Publish\Core\FieldType\FieldType\acceptValue().

## ◆ checkValueType()

static eZ\Publish\Core\FieldType\FieldType::checkValueType | ( |  | $value | ) |
| static protected

Throws an exception if the given $value is not an instance of the supported value subtype.

This is an operation method for {

See also
  acceptValue()}.

Default implementation expects the value class to reside in the same namespace as its FieldType class and is named "Value".

Example implementation: `static protected function checkValueType( $value ) { if ( !$inputValue instanceof \eZ\Publish\Core\FieldType\CookieJar\Value ) ) { throw new InvalidArgumentException( "Given value type is not supported." ); } }`

Exceptions

Definition at line 445 of file Core/FieldType/FieldType.php.

## ◆ createValueFromInput()

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

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

If given $inputValue could not be converted or is already an instance of dedicate value object, the method should simply return it.

This is an operation method for {

See also
  acceptValue()}.

Example implementation: `protected function createValueFromInput( $inputValue ) { if ( is_array( $inputValue ) ) { $inputValue = \eZ\Publish\Core\FieldType\CookieJar\Value( $inputValue ); }`

`return $inputValue; }`

Parameters

  mixed | $inputValue |

Returns
  mixed The potentially converted input value.

Reimplemented in eZ\Publish\Core\FieldType\User\Type, eZ\Publish\Core\FieldType\Url\Type, eZ\Publish\Core\FieldType\Time\Type, eZ\Publish\Core\FieldType\TextLine\Type, eZ\Publish\Core\FieldType\TextBlock\Type, eZ\Publish\Core\FieldType\Selection\Type, eZ\Publish\Core\FieldType\RichText\Type, eZ\Publish\Core\FieldType\RelationList\Type, eZ\Publish\Core\FieldType\Relation\Type, eZ\Publish\Core\FieldType\Rating\Type, eZ\Publish\Core\FieldType\Page\Type, eZ\Publish\Core\FieldType\Null\Type, eZ\Publish\Core\FieldType\MapLocation\Type, eZ\Publish\Core\FieldType\Keyword\Type, eZ\Publish\Core\FieldType\ISBN\Type, eZ\Publish\Core\FieldType\Integer\Type, eZ\Publish\Core\FieldType\ImageAsset\Type, eZ\Publish\Core\FieldType\Image\Type, eZ\Publish\Core\FieldType\Float\Type, eZ\Publish\Core\FieldType\EmailAddress\Type, eZ\Publish\Core\FieldType\DateAndTime\Type, eZ\Publish\Core\FieldType\Date\Type, eZ\Publish\Core\FieldType\Country\Type, eZ\Publish\Core\FieldType\Checkbox\Type, eZ\Publish\Core\FieldType\BinaryBase\Type, and eZ\Publish\Core\FieldType\Author\Type.

Referenced by eZ\Publish\Core\FieldType\FieldType\acceptValue().

## ◆ fieldSettingsFromHash()

eZ\Publish\Core\FieldType\FieldType::fieldSettingsFromHash | ( |  | $fieldSettingsHash | ) |

Converts the given $fieldSettingsHash to field settings of the type.

This is the reverse operation of fieldSettingsToHash().

This is the default implementation, which just returns the given $fieldSettingsHash, assuming the supported field settings are already in a hash format. Overwrite this in your specific implementation, if necessary.

Parameters

  array | hash | scalar | null | $fieldSettingsHash |

Returns
  mixed

Implements eZ\Publish\SPI\FieldType\FieldType.

Reimplemented in eZ\Publish\Core\FieldType\DateAndTime\Type.

Definition at line 511 of file Core/FieldType/FieldType.php.

## ◆ fieldSettingsToHash()

eZ\Publish\Core\FieldType\FieldType::fieldSettingsToHash | ( |  | $fieldSettings | ) |

Converts the given $fieldSettings to a simple hash format.

This is the default implementation, which just returns the given $fieldSettings, assuming they are already in a hash format. Overwrite this in your specific implementation, if necessary.

Parameters

  mixed | $fieldSettings |

Returns
  array|hash|scalar|null

Implements eZ\Publish\SPI\FieldType\FieldType.

Reimplemented in eZ\Publish\Core\FieldType\DateAndTime\Type.

Definition at line 492 of file Core/FieldType/FieldType.php.

## ◆ fromPersistenceValue()

eZ\Publish\Core\FieldType\FieldType::fromPersistenceValue | ( | PersistenceValue | $fieldValue | ) |

Converts a persistence $fieldValue to a Value.

Parameters

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

Returns
  \eZ\Publish\Core\FieldType\Value

Reimplemented in eZ\Publish\Core\FieldType\BinaryBase\Type.

Definition at line 304 of file Core/FieldType/FieldType.php.

References eZ\Publish\SPI\FieldType\FieldType\fromHash().

## ◆ getRelations()

eZ\Publish\Core\FieldType\FieldType::getRelations | ( | SPIValue | $fieldValue | ) |

Returns relation data extracted from value.

Not intended for \eZ\Publish\API\Repository\Values\Content\Relation::COMMON type relations, there is an API for handling those.

Parameters

  \eZ\Publish\Core\FieldType\Value | $fieldValue |

Returns
  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::FIELD => array( 12 ) )`

Reimplemented in eZ\Publish\Core\FieldType\RelationList\Type, eZ\Publish\Core\FieldType\Relation\Type, and eZ\Publish\Core\FieldType\ImageAsset\Type.

Definition at line 575 of file Core/FieldType/FieldType.php.

## ◆ getSettingsSchema()

eZ\Publish\Core\FieldType\FieldType::getSettingsSchema | ( |  | ) |

Returns a schema for the settings expected by the FieldType.

This implementation returns an array. where the key is the setting name, and the value is the default value for given setting and set to null if no particular default should be set.

Returns
  mixed

Implements eZ\Publish\SPI\FieldType\FieldType.

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

References eZ\Publish\Core\FieldType\FieldType\$settingsSchema.

Referenced by eZ\Publish\Core\FieldType\FieldType\applyDefaultSettings().

## ◆ getSortInfo()

eZ\Publish\Core\FieldType\FieldType::getSortInfo | ( | Value | $value | ) |
| protected

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

Return value is mixed. It should be something which is sensible for sorting.

It is up to the persistence implementation to handle those values. Common string and integer values are safe.

For the legacy storage it is up to the field converters to set this value in either sort_key_string or sort_key_int.

In case of multi value, values should be string and separated by "-" or ",".

Parameters

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

Returns
  mixed

Definition at line 271 of file Core/FieldType/FieldType.php.

Referenced by eZ\Publish\Core\FieldType\FieldType\toPersistenceValue().

## ◆ getValidatorConfigurationSchema()

eZ\Publish\Core\FieldType\FieldType::getValidatorConfigurationSchema | ( |  | ) |

Returns a schema for the validator configuration expected by the FieldType.

See also
  FieldTypeInterface::getValidatorConfigurationSchema()

This implementation returns a three dimensional map containing for each validator configuration referenced by identifier a map of supported parameters which are defined by a type and a default value (see example).

`array( 'stringLength' => array( 'minStringLength' => array( 'type' => 'int', 'default' => 0, ), 'maxStringLength' => array( 'type' => 'int' 'default' => null, ) ), );`

Returns
  mixed

Implements eZ\Publish\SPI\FieldType\FieldType.

Definition at line 114 of file Core/FieldType/FieldType.php.

References eZ\Publish\Core\FieldType\FieldType\$validatorConfigurationSchema.

Referenced by eZ\Publish\Core\FieldType\FieldType\applyDefaultValidatorConfiguration().

## ◆ isEmptyValue()

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

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

Default implementation, which performs a "==" check with the value returned by getEmptyValue(). Overwrite in the specific field type, if necessary.

Parameters

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

Returns
  bool

Reimplemented in eZ\Publish\Core\FieldType\Time\Type, eZ\Publish\Core\FieldType\TextLine\Type, eZ\Publish\Core\FieldType\TextBlock\Type, eZ\Publish\Core\FieldType\RichText\Type, eZ\Publish\Core\FieldType\Relation\Type, eZ\Publish\Core\FieldType\Rating\Type, eZ\Publish\Core\FieldType\Page\Type, eZ\Publish\Core\FieldType\MapLocation\Type, eZ\Publish\Core\FieldType\ISBN\Type, eZ\Publish\Core\FieldType\Integer\Type, eZ\Publish\Core\FieldType\ImageAsset\Type, and eZ\Publish\Core\FieldType\Float\Type.

Definition at line 350 of file Core/FieldType/FieldType.php.

References eZ\Publish\SPI\FieldType\FieldType\getEmptyValue().

Referenced by eZ\Publish\Core\FieldType\FieldType\acceptValue(), eZ\Publish\Core\FieldType\Date\Type\getName(), eZ\Publish\Core\FieldType\DateAndTime\Type\getName(), eZ\Publish\Core\FieldType\BinaryFile\Type\toHash(), eZ\Publish\Core\FieldType\Country\Type\toHash(), eZ\Publish\Core\FieldType\Date\Type\toHash(), eZ\Publish\Core\FieldType\DateAndTime\Type\toHash(), eZ\Publish\Core\FieldType\EmailAddress\Type\toHash(), eZ\Publish\Core\FieldType\Image\Type\toHash(), eZ\Publish\Core\FieldType\Media\Type\toHash(), eZ\Publish\Core\FieldType\Url\Type\toHash(), eZ\Publish\Core\FieldType\User\Type\toHash(), eZ\Publish\Core\FieldType\BinaryBase\Type\validate(), eZ\Publish\Core\FieldType\Country\Type\validate(), eZ\Publish\Core\FieldType\EmailAddress\Type\validate(), eZ\Publish\Core\FieldType\Image\Type\validate(), eZ\Publish\Core\FieldType\RelationList\Type\validate(), eZ\Publish\Core\FieldType\Selection\Type\validate(), and eZ\Publish\Core\FieldType\User\Type\validate().

## ◆ isSearchable()

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

Returns whether the field type is searchable.

Returns
  bool

Implements eZ\Publish\SPI\FieldType\FieldType.

Reimplemented in eZ\Publish\Core\FieldType\Time\Type, eZ\Publish\Core\FieldType\TextLine\Type, eZ\Publish\Core\FieldType\TextBlock\Type, eZ\Publish\Core\FieldType\Selection\Type, eZ\Publish\Core\FieldType\RichText\Type, eZ\Publish\Core\FieldType\RelationList\Type, eZ\Publish\Core\FieldType\Relation\Type, eZ\Publish\Core\FieldType\Rating\Type, eZ\Publish\Core\FieldType\Null\Type, eZ\Publish\Core\FieldType\Media\Type, eZ\Publish\Core\FieldType\MapLocation\Type, eZ\Publish\Core\FieldType\Keyword\Type, eZ\Publish\Core\FieldType\ISBN\Type, eZ\Publish\Core\FieldType\Integer\Type, eZ\Publish\Core\FieldType\ImageAsset\Type, eZ\Publish\Core\FieldType\EmailAddress\Type, eZ\Publish\Core\FieldType\DateAndTime\Type, eZ\Publish\Core\FieldType\Date\Type, eZ\Publish\Core\FieldType\Country\Type, eZ\Publish\Core\FieldType\Checkbox\Type, eZ\Publish\Core\FieldType\BinaryBase\Type, and eZ\Publish\Core\FieldType\Author\Type.

Definition at line 314 of file Core/FieldType/FieldType.php.

## ◆ isSingular()

eZ\Publish\Core\FieldType\FieldType::isSingular | ( |  | ) |

Indicates if the field definition of this type can appear only once in the same ContentType.

Returns
  bool

Implements eZ\Publish\SPI\FieldType\FieldType.

Reimplemented in eZ\Publish\Core\FieldType\User\Type.

Definition at line 324 of file Core/FieldType/FieldType.php.

## ◆ onlyEmptyInstance()

eZ\Publish\Core\FieldType\FieldType::onlyEmptyInstance | ( |  | ) |

Indicates if the field definition of this type can be added to a ContentType with Content instances.

Returns
  bool

Implements eZ\Publish\SPI\FieldType\FieldType.

Reimplemented in eZ\Publish\Core\FieldType\User\Type.

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

## ◆ setTransformationProcessor()

eZ\Publish\Core\FieldType\FieldType::setTransformationProcessor | ( | TransformationProcessor | $transformationProcessor | ) |

Parameters

  \eZ\Publish\Core\Persistence\TransformationProcessor | $transformationProcessor |

Definition at line 69 of file Core/FieldType/FieldType.php.

References eZ\Publish\Core\FieldType\FieldType\$transformationProcessor.

## ◆ toPersistenceValue()

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

Converts a $value to a persistence value.

Parameters

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

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

Reimplemented in eZ\Publish\Core\FieldType\User\Type, eZ\Publish\Core\FieldType\Url\Type, eZ\Publish\Core\FieldType\RichText\Type, eZ\Publish\Core\FieldType\Page\Type, eZ\Publish\Core\FieldType\MapLocation\Type, eZ\Publish\Core\FieldType\Keyword\Type, eZ\Publish\Core\FieldType\Image\Type, and eZ\Publish\Core\FieldType\BinaryBase\Type.

Definition at line 283 of file Core/FieldType/FieldType.php.

References eZ\Publish\Core\FieldType\FieldType\getSortInfo(), and eZ\Publish\SPI\FieldType\FieldType\toHash().

## ◆ validate()

eZ\Publish\Core\FieldType\FieldType::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 in eZ\Publish\Core\FieldType\RichText\Type, eZ\Publish\Core\FieldType\User\Type, eZ\Publish\Core\FieldType\TextLine\Type, eZ\Publish\Core\FieldType\Selection\Type, eZ\Publish\Core\FieldType\RelationList\Type, eZ\Publish\Core\FieldType\Relation\Type, eZ\Publish\Core\FieldType\ISBN\Type, eZ\Publish\Core\FieldType\Integer\Type, eZ\Publish\Core\FieldType\ImageAsset\Type, eZ\Publish\Core\FieldType\Image\Type, eZ\Publish\Core\FieldType\Float\Type, eZ\Publish\Core\FieldType\EmailAddress\Type, eZ\Publish\Core\FieldType\Country\Type, and eZ\Publish\Core\FieldType\BinaryBase\Type.

Definition at line 133 of file Core/FieldType/FieldType.php.

## ◆ validateFieldSettings()

eZ\Publish\Core\FieldType\FieldType::validateFieldSettings | ( |  | $fieldSettings | ) |

Validates the fieldSettings of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct.

This method expects that given $fieldSettings are complete, for this purpose method self::applyDefaultSettings() is provided.

Parameters

  mixed | $fieldSettings |

Returns
  \eZ\Publish\SPI\FieldType\ValidationError[]

Implements eZ\Publish\SPI\FieldType\FieldType.

Reimplemented in eZ\Publish\Core\FieldType\User\Type, eZ\Publish\Core\FieldType\Time\Type, eZ\Publish\Core\FieldType\TextBlock\Type, eZ\Publish\Core\FieldType\Selection\Type, eZ\Publish\Core\FieldType\RelationList\Type, eZ\Publish\Core\FieldType\Relation\Type, eZ\Publish\Core\FieldType\Page\Type, eZ\Publish\Core\FieldType\Media\Type, eZ\Publish\Core\FieldType\ISBN\Type, eZ\Publish\Core\FieldType\DateAndTime\Type, eZ\Publish\Core\FieldType\Date\Type, eZ\Publish\Core\FieldType\Country\Type, and eZ\Publish\Core\FieldType\Author\Type.

Definition at line 211 of file Core/FieldType/FieldType.php.

References eZ\Publish\SPI\FieldType\FieldType\getFieldTypeIdentifier().

## ◆ validateValidatorConfiguration()

eZ\Publish\Core\FieldType\FieldType::validateValidatorConfiguration | ( |  | $validatorConfiguration | ) |

Validates the validatorConfiguration of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct.

This method expects that given $validatorConfiguration is complete, for this purpose method self::applyDefaultValidatorConfiguration() is provided.

This is a base implementation, returning a validation error for each specified validator, since by default no validators are supported. Overwrite in derived types, if validation is supported.

Parameters

  mixed | $validatorConfiguration |

Returns
  \eZ\Publish\SPI\FieldType\ValidationError[]

Implements eZ\Publish\SPI\FieldType\FieldType.

Reimplemented in eZ\Publish\Core\FieldType\User\Type, eZ\Publish\Core\FieldType\TextLine\Type, eZ\Publish\Core\FieldType\RelationList\Type, eZ\Publish\Core\FieldType\Integer\Type, eZ\Publish\Core\FieldType\Image\Type, eZ\Publish\Core\FieldType\Float\Type, eZ\Publish\Core\FieldType\EmailAddress\Type, and eZ\Publish\Core\FieldType\BinaryBase\Type.

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

## ◆ validatorConfigurationFromHash()

eZ\Publish\Core\FieldType\FieldType::validatorConfigurationFromHash | ( |  | $validatorConfigurationHash | ) |

Converts the given $validatorConfigurationHash to a validator configuration of the type.

Default implementation, which just returns the given $validatorConfigurationHash, since the validator configuration is by convention an array for all internal field types. Overwrite this method, if necessary.

Parameters

  array | hash | scalar | null | $validatorConfigurationHash |

Returns
  mixed

Implements eZ\Publish\SPI\FieldType\FieldType.

Definition at line 545 of file Core/FieldType/FieldType.php.

## ◆ validatorConfigurationToHash()

eZ\Publish\Core\FieldType\FieldType::validatorConfigurationToHash | ( |  | $validatorConfiguration | ) |

Converts the given $validatorConfiguration to a simple hash format.

Default implementation, which just returns the given $validatorConfiguration, which is by convention an array for all internal field types. Overwrite this method, if necessary.

Parameters

  mixed | $validatorConfiguration |

Returns
  array|hash|scalar|null

Implements eZ\Publish\SPI\FieldType\FieldType.

Definition at line 527 of file Core/FieldType/FieldType.php.

## ◆ valuesEqual()

eZ\Publish\Core\FieldType\FieldType::valuesEqual | ( | SPIValue | $value1,
|  | SPIValue | $value2
| ) |  |

Reimplemented in eZ\Publish\Core\FieldType\Image\Type.

Definition at line 580 of file Core/FieldType/FieldType.php.

References eZ\Publish\SPI\FieldType\FieldType\toHash().

## Member Data Documentation

## ◆ $settingsSchema

eZ\Publish\Core\FieldType\FieldType::$settingsSchema = []
| protected

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

Referenced by eZ\Publish\Core\FieldType\FieldType\getSettingsSchema().

## ◆ $transformationProcessor

eZ\Publish\Core\FieldType\FieldType::$transformationProcessor
| protected

Definition at line 64 of file Core/FieldType/FieldType.php.

Referenced by eZ\Publish\Core\FieldType\FieldType\setTransformationProcessor().

## ◆ $validatorConfigurationSchema

eZ\Publish\Core\FieldType\FieldType::$validatorConfigurationSchema = []
| protected

Definition at line 57 of file Core/FieldType/FieldType.php.

Referenced by eZ\Publish\Core\FieldType\FieldType\getValidatorConfigurationSchema().

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

- Core/FieldType/FieldType.php

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