function TestStateBasedSectionStorage::isApplicable

Same name and namespace in other branches
  1. 11.x core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/SectionStorage/TestStateBasedSectionStorage.php \Drupal\layout_builder_test\Plugin\SectionStorage\TestStateBasedSectionStorage::isApplicable()
  2. 10 core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/SectionStorage/TestStateBasedSectionStorage.php \Drupal\layout_builder_test\Plugin\SectionStorage\TestStateBasedSectionStorage::isApplicable()
  3. 9 core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/SectionStorage/TestStateBasedSectionStorage.php \Drupal\layout_builder_test\Plugin\SectionStorage\TestStateBasedSectionStorage::isApplicable()

File

core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/SectionStorage/TestStateBasedSectionStorage.php, line 38

Class

TestStateBasedSectionStorage
Provides a test section storage that is controlled by state.

Namespace

Drupal\layout_builder_test\Plugin\SectionStorage

Code

public function isApplicable(RefinableCacheableDependencyInterface $cacheability) {
  $cacheability->mergeCacheMaxAge(0);
  return \Drupal::state()->get('layout_builder_test_state', FALSE);
}

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