You are here

protected function LayoutTempstoreRepository::getKey in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/src/LayoutTempstoreRepository.php \Drupal\layout_builder\LayoutTempstoreRepository::getKey()
  2. 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.

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();
}