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

SPI/FieldType/FieldType.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\SPI\FieldType;
8
9 use eZ\Publish\API\Repository\Values\ContentType\FieldDefinition;
10 use eZ\Publish\SPI\Persistence\Content\FieldValue;
11
29 interface FieldType
30 {
42 public function getFieldTypeIdentifier();
43
58 public function getName(Value $value);
59
79 public function getSettingsSchema();
80
120 public function getValidatorConfigurationSchema();
121
132 public function validate(FieldDefinition $fieldDef, Value $value);
133
145 public function validateValidatorConfiguration($validatorConfiguration);
146
154 public function applyDefaultValidatorConfiguration(&$validatorConfiguration);
155
166 public function validateFieldSettings($fieldSettings);
167
175 public function applyDefaultSettings(&$fieldSettings);
176
182 public function isSearchable();
183
189 public function isSingular();
190
196 public function onlyEmptyInstance();
197
208 public function getEmptyValue();
209
221 public function isEmptyValue(Value $value);
222
244 public function acceptValue($inputValue);
245
258 public function fromHash($hash);
259
272 public function toHash(Value $value);
273
283 public function fieldSettingsToHash($fieldSettings);
284
295 public function fieldSettingsFromHash($fieldSettingsHash);
296
306 public function validatorConfigurationToHash($validatorConfiguration);
307
318 public function validatorConfigurationFromHash($validatorConfigurationHash);
319
342 public function toPersistenceValue(Value $value);
343
353 public function fromPersistenceValue(FieldValue $fieldValue);
354
380 public function getRelations(Value $value);
381 }
eZ\Publish\API\Repository\Values\ContentType\FieldDefinition
Definition: API/Repository/Values/ContentType/FieldDefinition.php:31
eZ\Publish\SPI\Persistence\Content\FieldValue
Definition: FieldValue.php:12
eZ\Publish\SPI\FieldType\FieldType
The field type interface which all field types have to implement.
Definition: SPI/FieldType/FieldType.php:30
eZ\Publish\SPI\FieldType\FieldType\applyDefaultValidatorConfiguration
applyDefaultValidatorConfiguration(&$validatorConfiguration)
Applies the default values to the given $validatorConfiguration of a FieldDefinitionCreateStruct.
eZ\Publish\SPI\FieldType\FieldType\fieldSettingsFromHash
fieldSettingsFromHash($fieldSettingsHash)
Converts the given $fieldSettingsHash to field settings of the type.
eZ\Publish\SPI\FieldType\FieldType\validatorConfigurationToHash
validatorConfigurationToHash($validatorConfiguration)
Converts the given $validatorConfiguration to a simple hash format.
eZ\Publish\SPI\FieldType\FieldType\fromPersistenceValue
fromPersistenceValue(FieldValue $fieldValue)
Converts a persistence $value to a Value.
eZ\Publish\SPI\FieldType\FieldType\getFieldTypeIdentifier
getFieldTypeIdentifier()
Returns the field type identifier for this field type.
eZ\Publish\SPI\FieldType\FieldType\isSearchable
isSearchable()
Indicates if the field type supports indexing and sort keys for searching.
eZ\Publish\SPI\FieldType\FieldType\applyDefaultSettings
applyDefaultSettings(&$fieldSettings)
Applies the default values to the fieldSettings of a FieldDefinitionCreateStruct.
eZ\Publish\SPI\FieldType\FieldType\getName
getName(Value $value)
Returns a human readable string representation from the given $value.
eZ\Publish\SPI\FieldType\FieldType\validateValidatorConfiguration
validateValidatorConfiguration($validatorConfiguration)
Validates the validatorConfiguration of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct.
eZ\Publish\SPI\FieldType\FieldType\fieldSettingsToHash
fieldSettingsToHash($fieldSettings)
Converts the given $fieldSettings to a simple hash format.
eZ\Publish\SPI\FieldType\FieldType\getEmptyValue
getEmptyValue()
Returns the empty value for this field type.
eZ\Publish\SPI\FieldType\FieldType\fromHash
fromHash($hash)
Converts an $hash to the Value defined by the field type.
eZ\Publish\SPI\FieldType\FieldType\toPersistenceValue
toPersistenceValue(Value $value)
Converts a $value to a persistence value.
eZ\Publish\SPI\FieldType\FieldType\validate
validate(FieldDefinition $fieldDef, Value $value)
Validates a field based on the validator configuration in the field definition.
eZ\Publish\SPI\FieldType\FieldType\getValidatorConfigurationSchema
getValidatorConfigurationSchema()
Returns a schema for the validator configuration expected by the FieldType.
eZ\Publish\SPI\FieldType\FieldType\onlyEmptyInstance
onlyEmptyInstance()
Indicates if the field definition of this type can be added to a ContentType with Content instances.
eZ\Publish\SPI\FieldType\FieldType\isEmptyValue
isEmptyValue(Value $value)
Returns if the given $value is considered empty by the field type.
eZ\Publish\SPI\FieldType\FieldType\getSettingsSchema
getSettingsSchema()
Returns a schema for the settings expected by the FieldType.
eZ\Publish\SPI\FieldType\FieldType\getRelations
getRelations(Value $value)
Returns relation data extracted from value.
eZ\Publish\SPI\FieldType\FieldType\toHash
toHash(Value $value)
Converts the given $value into a plain hash format.
eZ\Publish\SPI\FieldType\FieldType\validatorConfigurationFromHash
validatorConfigurationFromHash($validatorConfigurationHash)
Converts the given $validatorConfigurationHash to a validator configuration of the type.
eZ\Publish\SPI\FieldType\FieldType\validateFieldSettings
validateFieldSettings($fieldSettings)
Validates the fieldSettings of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct.
eZ\Publish\SPI\FieldType\FieldType\isSingular
isSingular()
Indicates if the field definition of this type can appear only once in the same ContentType.
eZ\Publish\SPI\FieldType\FieldType\acceptValue
acceptValue($inputValue)
Potentially builds and checks the type and structure of the $inputValue.
eZ\Publish\SPI\FieldType\Value
Interface for field value classes.
Definition: SPI/FieldType/Value.php:13
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.