function TestStateBasedSectionStorage::getSections

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

Overrides SectionStorageBase::getSections

File

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

Class

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

Namespace

Drupal\layout_builder_test\Plugin\SectionStorage

Code

public function getSections() {
    // Return a custom section.
    $section = new Section('layout_onecol');
    $section->appendComponent(new SectionComponent('fake-uuid', 'content', [
        'id' => 'system_powered_by_block',
        'label' => 'Test block title',
        'label_display' => 'visible',
    ]));
    return [
        $section,
    ];
}

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