Class

eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\ConverterRegistry

class ConverterRegistry

Methods

__construct(array $converterMap = array())

Create converter registry with converter map.

register(string $typeName, mixed $converter)

Register a $converter for $typeName.

Converter getConverter(string $typeName)

Returns converter for $typeName.

Details

at line 36
public __construct(array $converterMap = array())

Create converter registry with converter map.

In $converterMap a array consists of a mapping of field type names to object / callable is expected, in case of callable factory converter object should be returned on execution. The object is used to convert content fields and content type field definitions to the legacy storage engine. The given class names must derive the {@link \eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter} interface.

Parameters

array $converterMap A map where key is field type name, and value is a callable factory to get Converter OR Converter object

at line 47
public register(string $typeName, mixed $converter)

Register a $converter for $typeName.

Parameters

string $typeName
mixed $converter Callable or converter instance

at line 62
public Converter getConverter(string $typeName)

Returns converter for $typeName.

Parameters

string $typeName

Return Value

Converter

Exceptions

NotFound
RuntimeException When type is neither Converter instance or callable factory