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

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

Protected Properties

Property Type Description
$storageMap array Map of storages.

Public Methods

Method Description
__construct ( array $storageMap ) Create field storage registry with converter map.
getStorage ( string $typeName ) : eZ\Publish\SPI\FieldType\FieldStorage Returns the storage for $typeName.
register ( string $typeName, mixed $storage ) Register $storage for $typeName.

Method Details

__construct() public method

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

getStorage() public method

Returns the storage for $typeName.
public getStorage ( string $typeName ) : eZ\Publish\SPI\FieldType\FieldStorage
$typeName string
return eZ\Publish\SPI\FieldType\FieldStorage

register() public method

Register $storage for $typeName.
public register ( string $typeName, mixed $storage )
$typeName string
$storage mixed Callable or FieldStorage

Property Details

$storageMap protected property

Map of storages.
protected array $storageMap
return array