public function OverridesSectionStorage::getTempstoreKey in Drupal 10
Same name and namespace in other branches
- 8 core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php \Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage::getTempstoreKey()
- 9 core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php \Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage::getTempstoreKey()
File
- core/
modules/ layout_builder/ src/ Plugin/ SectionStorage/ OverridesSectionStorage.php, line 150
Class
- OverridesSectionStorage
- Defines the 'overrides' section storage type.
Namespace
Drupal\layout_builder\Plugin\SectionStorageCode
public function getTempstoreKey() {
$key = parent::getTempstoreKey();
$key .= '.' . $this
->getContextValue('view_mode');
$entity = $this
->getEntity();
// @todo Allow entities to provide this contextual information in
// https://www.drupal.org/project/drupal/issues/3026957.
if ($entity instanceof TranslatableInterface) {
$key .= '.' . $entity
->language()
->getId();
}
return $key;
}