You are here

public function LayoutTempstoreRepository::has in Drupal 8

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

Checks for the existence of a tempstore version of a section storage.

Parameters

\Drupal\layout_builder\SectionStorageInterface $section_storage: The section storage to check for in tempstore.

Return value

bool TRUE if there is a tempstore version of this section storage.

Overrides LayoutTempstoreRepositoryInterface::has

File

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

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);
  $tempstore = $this
    ->getTempstore($section_storage)
    ->get($key);
  return !empty($tempstore['section_storage']);
}