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
Afficher le fichier Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Свойство Type Description
$gateways StorageGateway[] Gateways.

Méthodes publiques

Méthode 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.

Méthodes protégées

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

Method Details

__construct() public méthode

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

addGateway() public méthode

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

copyLegacyField() public méthode

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
Résultat null | boolean Same as {@link \eZ\Publish\SPI\FieldType\FieldStorage::storeFieldData()}.

getGateway() protected méthode

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

Property Details

$gateways protected_oe property

Gateways.
protected StorageGateway[],eZ\Publish\Core\FieldType $gateways
Résultat StorageGateway[]