function SimpleConfigSectionStorage::getSections

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

Overrides SectionListInterface::getSections

1 call to SimpleConfigSectionStorage::getSections()
SimpleConfigSectionStorage::save in core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/SectionStorage/SimpleConfigSectionStorage.php
Saves the sections.

File

core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/SectionStorage/SimpleConfigSectionStorage.php, line 104

Class

SimpleConfigSectionStorage
Provides section storage utilizing simple config.

Namespace

Drupal\layout_builder_test\Plugin\SectionStorage

Code

public function getSections() {
    if (is_null($this->sections)) {
        $sections = $this->configFactory
            ->get($this->getConfigName())
            ->get('sections') ?: [];
        $this->setSections(array_map([
            Section::class,
            'fromArray',
        ], $sections));
    }
    return $this->sections;
}

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