PHP Class eZ\Publish\Core\FieldType\GatewayBasedStorage

This class gives a common basis to realized gateway based storage dispatching. It is intended to deal as a base class for FieldType storages, giving a common infrastructure to handle multiple gateways, based on the context provided by the SPI. The method {@link getGateway()} is used in derived classes to retrieve the correct gateway implementation, based on the context.
Inheritance: implements eZ\Publish\SPI\FieldType\FieldStorage
Mostrar archivo Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Property Type Description
$gateways StorageGateway[] Gateways.

Public Methods

Method Description
__construct ( array $gateways = [] ) Construct from gateways.
addGateway ( string $identifier, StorageGateway $gateway ) Adds a storage $gateway assigned to the given $identifier.
copyLegacyField ( eZ\Publish\SPI\Persistence\Content\VersionInfo $versionInfo, eZ\Publish\SPI\Persistence\Content\Field $field, eZ\Publish\SPI\Persistence\Content\Field $originalField, array $context ) : null | boolean This method is used exclusively by Legacy Storage to copy external data of existing field in main language to the untranslatable field not passed in create or update struct, but created implicitly in storage layer.

Protected Methods

Method Description
getGateway ( array $context ) : StorageGateway Retrieve the fitting gateway, base on the identifier in $context.

Method Details

__construct() public method

Construct from gateways.
public __construct ( array $gateways = [] )
$gateways array

addGateway() public method

Adds a storage $gateway assigned to the given $identifier.
public addGateway ( string $identifier, StorageGateway $gateway )
$identifier string
$gateway StorageGateway

copyLegacyField() public method

By default the method falls back to the {@link \eZ\Publish\SPI\FieldType\FieldStorage::storeFieldData()}. External storages implement this method as needed.
public copyLegacyField ( eZ\Publish\SPI\Persistence\Content\VersionInfo $versionInfo, eZ\Publish\SPI\Persistence\Content\Field $field, eZ\Publish\SPI\Persistence\Content\Field $originalField, array $context ) : null | boolean
$versionInfo eZ\Publish\SPI\Persistence\Content\VersionInfo
$field eZ\Publish\SPI\Persistence\Content\Field
$originalField eZ\Publish\SPI\Persistence\Content\Field
$context array
return null | boolean Same as {@link \eZ\Publish\SPI\FieldType\FieldStorage::storeFieldData()}.

getGateway() protected method

Retrieve the fitting gateway, base on the identifier in $context.
protected getGateway ( array $context ) : StorageGateway
$context array
return StorageGateway

Property Details

$gateways protected_oe property

Gateways.
protected StorageGateway[],eZ\Publish\Core\FieldType $gateways
return StorageGateway[]