function TestStateBasedSectionStorage::isSupported

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::isSupported()

Determines if layout builder is supported by a view mode.

Parameters

string $entity_type_id: The entity type id.

string $bundle: The bundle.

string $view_mode: The view mode.

Return value

bool TRUE if it is supported, otherwise FALSE.

Overrides SupportAwareSectionStorageInterface::isSupported

File

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

Class

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

Namespace

Drupal\layout_builder_test\Plugin\SectionStorage

Code

public function isSupported(string $entity_type_id, string $bundle, string $view_mode) : bool {
  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.