eZPublishCommunityProject  2012.12
eZ\Publish\API\Repository\FieldType Interface Reference
+ Inheritance diagram for eZ\Publish\API\Repository\FieldType:

Public Member Functions

 fieldSettingsFromHash ($fieldSettingsHash)
 Converts the given $fieldSettingsHash to field settings of the type. More...
 
 fieldSettingsToHash ($fieldSettings)
 Converts the given $fieldSettings to a simple hash format. More...
 
 fromHash ($hash)
 Converts an $hash to the Value defined by the field type. More...
 
 getEmptyValue ()
 Returns the empty value for this field type. More...
 
 getFieldTypeIdentifier ()
 Returns the field type identifier for this field type. More...
 
 getName ($value)
 Returns a human readable string representation from the given $value. More...
 
 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...
 
 isSearchable ()
 Indicates if the field type supports indexing and sort keys for searching. More...
 
 toHash ($value)
 Converts the given $value into a plain hash format. More...
 
 validatorConfigurationFromHash ($validatorConfigurationHash)
 Converts the given $validatorConfigurationHash to a validator configuration of the type. More...
 
 validatorConfigurationToHash ($validatorConfiguration)
 Converts the given $validatorConfiguration to a simple hash format. More...
 

Member Function Documentation

eZ\Publish\API\Repository\FieldType::fieldSettingsFromHash (   $fieldSettingsHash)

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

This is the reverse operation of fieldSettingsToHash().

Parameters
array | hash | scalar | null$fieldSettingsHash
Returns
mixed

Implemented in eZ\Publish\Core\FieldType\DateAndTime\Type, eZ\Publish\Core\FieldType\FieldType, eZ\Publish\Core\Repository\Values\ContentType\FieldType, and eZ\Publish\Core\REST\Client\FieldType.

eZ\Publish\API\Repository\FieldType::fieldSettingsToHash (   $fieldSettings)

Converts the given $fieldSettings to a simple hash format.

Parameters
mixed$fieldSettings
Returns
array|hash|scalar|null

Implemented in eZ\Publish\Core\FieldType\DateAndTime\Type, eZ\Publish\Core\FieldType\FieldType, eZ\Publish\Core\Repository\Values\ContentType\FieldType, and eZ\Publish\Core\REST\Client\FieldType.

eZ\Publish\API\Repository\FieldType::getSettingsSchema ( )

Returns a schema for the settings expected by the FieldType.

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.

Returns
mixed

Implemented in eZ\Publish\Core\Repository\Values\ContentType\FieldType, eZ\Publish\Core\FieldType\FieldType, and eZ\Publish\Core\REST\Client\FieldType.

eZ\Publish\API\Repository\FieldType::getValidatorConfigurationSchema ( )

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

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

Returns
mixed

Implemented in eZ\Publish\Core\Repository\Values\ContentType\FieldType, eZ\Publish\Core\REST\Client\FieldType, and eZ\Publish\Core\FieldType\FieldType.

eZ\Publish\API\Repository\FieldType::validatorConfigurationFromHash (   $validatorConfigurationHash)

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

Parameters
array | hash | scalar | null$validatorConfigurationHash
Returns
mixed

Implemented in eZ\Publish\Core\FieldType\FieldType, eZ\Publish\Core\Repository\Values\ContentType\FieldType, and eZ\Publish\Core\REST\Client\FieldType.

eZ\Publish\API\Repository\FieldType::validatorConfigurationToHash (   $validatorConfiguration)

Converts the given $validatorConfiguration to a simple hash format.

Parameters
mixed$validatorConfiguration
Returns
array|hash|scalar|null

Implemented in eZ\Publish\Core\FieldType\FieldType, eZ\Publish\Core\Repository\Values\ContentType\FieldType, and eZ\Publish\Core\REST\Client\FieldType.


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