PHP Class eZ\Publish\Core\Persistence\FieldTypeRegistry

Show file Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Property Type Description
$coreFieldTypeMap mixed Map of FieldTypes where key is field type identifier and value is FieldType object complying to {@link \eZ\Publish\SPI\FieldType\FieldType} interface or callable callback to generate one.
$fieldTypeMap eZ\Publish\SPI\Persistence\FieldType[] Map of FieldTypes where key is field type identifier and value is FieldType object.

Public Methods

Method Description
__construct ( array $fieldTypeMap ) Creates FieldType registry.
getFieldType ( string $identifier ) : eZ\Publish\SPI\Persistence\FieldType Returns the FieldType object for given $identifier.
register ( $identifier, mixed $fieldType ) Register $fieldType with $identifier.

Protected Methods

Method Description
getCoreFieldType ( string $identifier ) : eZ\Publish\SPI\FieldType\FieldType Instantiates a FieldType object.

Method Details

__construct() public method

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.
public __construct ( array $fieldTypeMap )
$fieldTypeMap array A map where key is field type identifier and value is a callable factory to get FieldType OR FieldType object.

getCoreFieldType() protected method

Instantiates a FieldType object.
protected getCoreFieldType ( string $identifier ) : eZ\Publish\SPI\FieldType\FieldType
$identifier string
return eZ\Publish\SPI\FieldType\FieldType

getFieldType() public method

Returns the FieldType object for given $identifier.
public getFieldType ( string $identifier ) : eZ\Publish\SPI\Persistence\FieldType
$identifier string
return eZ\Publish\SPI\Persistence\FieldType

register() public method

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.
public register ( $identifier, mixed $fieldType )
$identifier
$fieldType mixed Callable or FieldType instance.

Property Details

$coreFieldTypeMap protected property

Map of FieldTypes where key is field type identifier and value is FieldType object complying to {@link \eZ\Publish\SPI\FieldType\FieldType} interface or callable callback to generate one.
protected mixed $coreFieldTypeMap
return mixed

$fieldTypeMap protected property

Map of FieldTypes where key is field type identifier and value is FieldType object.
protected FieldType[],eZ\Publish\SPI\Persistence $fieldTypeMap
return eZ\Publish\SPI\Persistence\FieldType[]