Class

eZ\Publish\Core\Persistence\FieldTypeRegistry

class FieldTypeRegistry

Registry for field types available to storage engines.

Methods

__construct(array $fieldTypeMap)

Creates FieldType registry.

FieldType getFieldType(string $identifier)

Returns the FieldType object for given $identifier.

register($identifier $identifier, mixed $fieldType)

Register $fieldType with $identifier.

Details

at line 45
public __construct(array $fieldTypeMap)

Creates FieldType registry.

In $fieldTypeMap a mapping of field type identifier to object / callable is expected, in case of callable factory it should return the FieldType object. The FieldType object must comply to the {@link \eZ\Publish\SPI\FieldType\FieldType} interface.

Parameters

array $fieldTypeMap A map where key is field type identifier and value is a callable factory to get FieldType OR FieldType object.

at line 60
public FieldType getFieldType(string $identifier)

Returns the FieldType object for given $identifier.

Parameters

string $identifier

Return Value

FieldType

Exceptions

FieldTypeNotFoundException If field type for given $identifier is not found.
RuntimeException If field type for given $identifier is not instance or callable.

at line 79
public register($identifier $identifier, mixed $fieldType)

Register $fieldType with $identifier.

For $fieldType an object / callable is expected, in case of callable factory it should return the FieldType object. The FieldType object must comply to the {@link \eZ\Publish\SPI\FieldType\FieldType} interface.

Parameters

$identifier $identifier
mixed $fieldType Callable or FieldType instance.