Class

eZ\Publish\Core\Persistence\Legacy\Content\StorageRegistry

class StorageRegistry

Registry for external storages.

Methods

__construct(array $storageMap)

Create field storage registry with converter map.

register(string $typeName, mixed $storage)

Register $storage for $typeName.

FieldStorage getStorage(string $typeName)

Returns the storage for $typeName.

Details

at line 38
public __construct(array $storageMap)

Create field storage registry with converter map.

In $storageMap a mapping of field type names to object / callable is expected, in case of callable factory it should return the storage object. The object is used to store/restore/delete/… data in external storage (e.g.another database or a web service). The storage object must comply to the {@link \eZ\Publish\SPI\FieldType\FieldStorage} interface.

Parameters

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

at line 51
public register(string $typeName, mixed $storage)

Register $storage for $typeName.

Parameters

string $typeName
mixed $storage Callable or FieldStorage

at line 65
public FieldStorage getStorage(string $typeName)

Returns the storage for $typeName.

Parameters

string $typeName

Return Value

FieldStorage

Exceptions

RuntimeException When type is neither FieldStorage instance or callable factory