function LayoutTempstoreRepository::getKey

Same name in other branches
  1. 9 core/modules/layout_builder/src/LayoutTempstoreRepository.php \Drupal\layout_builder\LayoutTempstoreRepository::getKey()
  2. 8.9.x core/modules/layout_builder/src/LayoutTempstoreRepository.php \Drupal\layout_builder\LayoutTempstoreRepository::getKey()
  3. 10 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
LayoutTempstoreRepository::get in core/modules/layout_builder/src/LayoutTempstoreRepository.php
LayoutTempstoreRepository::has in core/modules/layout_builder/src/LayoutTempstoreRepository.php
LayoutTempstoreRepository::set in core/modules/layout_builder/src/LayoutTempstoreRepository.php

File

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

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.