final class ExportStorageManager implements StorageManagerInterface (View source)

The export storage manager dispatches an event for the export storage.

This class is not meant to be extended and is final to make sure the constructor and the getStorage method are both changed when this pattern is used in other circumstances.

Traits

Utility trait to copy configuration from one storage to another.

Constants

LOCK_NAME

The name used to identify the lock.

Properties

protected StorageInterface $active

The active configuration storage.

protected DatabaseStorage $storage

The database storage.

protected EventDispatcherInterface $eventDispatcher

The event dispatcher.

protected LockBackendInterface $lock

The used lock backend instance.

Methods

static 
replaceStorageContents(StorageInterface $source, StorageInterface $target)

Copy the configuration from one storage to another and remove stale items.

__construct(StorageInterface $active, Connection $connection, EventDispatcherInterface $event_dispatcher, LockBackendInterface $lock)

ExportStorageManager constructor.

getStorage()

Get the config storage.

Details

static protected replaceStorageContents(StorageInterface $source, StorageInterface $target)

Copy the configuration from one storage to another and remove stale items.

This method empties target storage and copies all collections from source. Configuration is only copied and not imported, should not be used with the active storage as the target.

Parameters

StorageInterface $source

The configuration storage to copy from.

StorageInterface $target

The configuration storage to copy to.

__construct(StorageInterface $active, Connection $connection, EventDispatcherInterface $event_dispatcher, LockBackendInterface $lock)

ExportStorageManager constructor.

Parameters

StorageInterface $active

The active config storage to prime the export storage.

Connection $connection

The database connection.

EventDispatcherInterface $event_dispatcher

The event dispatcher.

LockBackendInterface $lock

The used lock backend instance.

StorageInterface getStorage()

Get the config storage.

Return Value

StorageInterface

The config storage.

Exceptions

StorageTransformerException