function LayoutTempstoreRepository::has

Same name and namespace in other branches
  1. 9 core/modules/layout_builder/src/LayoutTempstoreRepository.php \Drupal\layout_builder\LayoutTempstoreRepository::has()
  2. 8.9.x core/modules/layout_builder/src/LayoutTempstoreRepository.php \Drupal\layout_builder\LayoutTempstoreRepository::has()
  3. 10 core/modules/layout_builder/src/LayoutTempstoreRepository.php \Drupal\layout_builder\LayoutTempstoreRepository::has()

File

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

Class

LayoutTempstoreRepository
Provides a mechanism for loading layouts from tempstore.

Namespace

Drupal\layout_builder

Code

public function has(SectionStorageInterface $section_storage) {
    $key = $this->getKey($section_storage);
    // Check if the storage is present in the static cache.
    if (isset($this->cache[$key])) {
        return TRUE;
    }
    $tempstore = $this->getTempstore($section_storage)
        ->get($key);
    return !empty($tempstore['section_storage']);
}

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