function OverridesSectionStorage::getTempstoreKey

Same name in other branches
  1. 9 core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php \Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage::getTempstoreKey()
  2. 8.9.x core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php \Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage::getTempstoreKey()
  3. 11.x core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php \Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage::getTempstoreKey()

Overrides SectionStorageBase::getTempstoreKey

File

core/modules/layout_builder/src/Plugin/SectionStorage/OverridesSectionStorage.php, line 159

Class

OverridesSectionStorage
Defines the 'overrides' section storage type.

Namespace

Drupal\layout_builder\Plugin\SectionStorage

Code

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

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