You are here

protected function LayoutTempstoreRepository::getKey in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/layout_builder/src/LayoutTempstoreRepository.php \Drupal\layout_builder\LayoutTempstoreRepository::getKey()

Gets the string to use as the tempstore key.

Parameters

\Drupal\layout_builder\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.

4 calls to LayoutTempstoreRepository::getKey()
LayoutTempstoreRepository::delete in core/modules/layout_builder/src/LayoutTempstoreRepository.php
Removes the tempstore version of a section storage.
LayoutTempstoreRepository::get in core/modules/layout_builder/src/LayoutTempstoreRepository.php
Gets the tempstore version of a section storage, if it exists.
LayoutTempstoreRepository::has in core/modules/layout_builder/src/LayoutTempstoreRepository.php
Checks for the existence of a tempstore version of a section storage.
LayoutTempstoreRepository::set in core/modules/layout_builder/src/LayoutTempstoreRepository.php
Stores this section storage in tempstore.

File

core/modules/layout_builder/src/LayoutTempstoreRepository.php, line 96

Class

LayoutTempstoreRepository
Provides a mechanism for loading layouts from tempstore.

Namespace

Drupal\layout_builder

Code

protected function getKey(SectionStorageInterface $section_storage) {
  if ($section_storage instanceof TempStoreIdentifierInterface) {
    return $section_storage
      ->getTempstoreKey();
  }
  return $section_storage
    ->getStorageId();
}