class LayoutTempstoreRepository implements LayoutTempstoreRepositoryInterface (View source)

Provides a mechanism for loading layouts from tempstore.

Properties

protected SharedTempStoreFactory $tempStoreFactory

The shared tempstore factory.

Methods

__construct(SharedTempStoreFactory $temp_store_factory)

LayoutTempstoreRepository constructor.

get(SectionStorageInterface $section_storage)

Gets the tempstore version of a section storage, if it exists.

bool
has(SectionStorageInterface $section_storage)

Checks for the existence of a tempstore version of a section storage.

set(SectionStorageInterface $section_storage)

Stores this section storage in tempstore.

delete(SectionStorageInterface $section_storage)

Removes the tempstore version of a section storage.

getTempstore(SectionStorageInterface $section_storage)

Gets the shared tempstore.

string
getKey(SectionStorageInterface $section_storage)

Gets the string to use as the tempstore key.

Details

__construct(SharedTempStoreFactory $temp_store_factory)

LayoutTempstoreRepository constructor.

Parameters

SharedTempStoreFactory $temp_store_factory

The shared tempstore factory.

SectionStorageInterface get(SectionStorageInterface $section_storage)

Gets the tempstore version of a section storage, if it exists.

Parameters

SectionStorageInterface $section_storage

The section storage to check for in tempstore.

Return Value

SectionStorageInterface

Either the version of this section storage from tempstore, or the passed section storage if none exists.

Exceptions

UnexpectedValueException

bool has(SectionStorageInterface $section_storage)

Checks for the existence of a tempstore version of a section storage.

Parameters

SectionStorageInterface $section_storage

The section storage to check for in tempstore.

Return Value

bool

TRUE if there is a tempstore version of this section storage.

set(SectionStorageInterface $section_storage)

Stores this section storage in tempstore.

Parameters

SectionStorageInterface $section_storage

The section storage to set in tempstore.

delete(SectionStorageInterface $section_storage)

Removes the tempstore version of a section storage.

Parameters

SectionStorageInterface $section_storage

The section storage to remove from tempstore.

protected SharedTempStore getTempstore(SectionStorageInterface $section_storage)

Gets the shared tempstore.

Parameters

SectionStorageInterface $section_storage

The section storage.

Return Value

SharedTempStore

The tempstore.

protected string getKey(SectionStorageInterface $section_storage)

Gets the string to use as the tempstore key.

Parameters

SectionStorageInterface $section_storage

The section storage.

Return Value

string

A unique string representing the section storage. This should include as much identifying information as possible about this particular storage, including information like the current language.