eZPublishCommunityProject  2013.4
eZ\Publish\Core\REST\Client\FieldType Class Reference
+ Inheritance diagram for eZ\Publish\Core\REST\Client\FieldType:
+ Collaboration diagram for eZ\Publish\Core\REST\Client\FieldType:

Public Member Functions

 __construct (SPI\FieldType\FieldType $innerFieldType)
 
 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 fallback default value of field type when no such default value is provided in the field definition in content types. 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 a Value to a hash. 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...
 

Protected Attributes

 $innerFieldType
 

Constructor & Destructor Documentation

eZ\Publish\Core\REST\Client\FieldType::__construct ( SPI\FieldType\FieldType  $innerFieldType)
Parameters
\eZ\Publish\SPI\FieldType\FieldType$innerFieldType

Member Function Documentation

eZ\Publish\Core\REST\Client\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

Implements eZ\Publish\API\Repository\FieldType.

eZ\Publish\Core\REST\Client\FieldType::fieldSettingsToHash (   $fieldSettings)

Converts the given $fieldSettings to a simple hash format.

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

Implements eZ\Publish\API\Repository\FieldType.

eZ\Publish\Core\REST\Client\FieldType::fromHash (   $hash)

Converts an $hash to the Value defined by the field type.

Parameters
mixed$hash
Returns
mixed

Implements eZ\Publish\API\Repository\FieldType.

eZ\Publish\Core\REST\Client\FieldType::getEmptyValue ( )

Returns the fallback default value of field type when no such default value is provided in the field definition in content types.

Returns
mixed

Implements eZ\Publish\API\Repository\FieldType.

eZ\Publish\Core\REST\Client\FieldType::getFieldTypeIdentifier ( )

Returns the field type identifier for this field type.

Returns
string

Implements eZ\Publish\API\Repository\FieldType.

Referenced by eZ\Publish\Core\REST\Client\FieldTypeService\addFieldType().

eZ\Publish\Core\REST\Client\FieldType::getName (   $value)

Returns a human readable string representation from the given $value.

Parameters
mixed$value
Returns
string

Implements eZ\Publish\API\Repository\FieldType.

eZ\Publish\Core\REST\Client\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 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.

Returns
mixed

Implements eZ\Publish\API\Repository\FieldType.

eZ\Publish\Core\REST\Client\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 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, ) ), );

Returns
mixed

Implements eZ\Publish\API\Repository\FieldType.

eZ\Publish\Core\REST\Client\FieldType::isSearchable ( )

Indicates if the field type supports indexing and sort keys for searching.

Returns
boolean

Implements eZ\Publish\API\Repository\FieldType.

eZ\Publish\Core\REST\Client\FieldType::toHash (   $value)

Converts a Value to a hash.

Parameters
mixed$value
Returns
mixed

Implements eZ\Publish\API\Repository\FieldType.

eZ\Publish\Core\REST\Client\FieldType::validatorConfigurationFromHash (   $validatorConfigurationHash)

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

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

Implements eZ\Publish\API\Repository\FieldType.

eZ\Publish\Core\REST\Client\FieldType::validatorConfigurationToHash (   $validatorConfiguration)

Converts the given $validatorConfiguration to a simple hash format.

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

Implements eZ\Publish\API\Repository\FieldType.

Member Data Documentation

eZ\Publish\Core\REST\Client\FieldType::$innerFieldType
protected

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