function SectionListTrait::setSections

Same name in other branches
  1. 9 core/modules/layout_builder/src/SectionListTrait.php \Drupal\layout_builder\SectionListTrait::setSections()
  2. 10 core/modules/layout_builder/src/SectionListTrait.php \Drupal\layout_builder\SectionListTrait::setSections()

Stores the information for all sections.

Implementations of this method are expected to call array_values() to rekey the list of sections.

Parameters

\Drupal\layout_builder\Section[] $sections: An array of section objects.

Return value

$this

5 calls to SectionListTrait::setSections()
SectionListTrait::insertSection in core/modules/layout_builder/src/SectionListTrait.php
SectionListTrait::removeAllSections in core/modules/layout_builder/src/SectionListTrait.php
SectionListTrait::removeSection in core/modules/layout_builder/src/SectionListTrait.php
SectionListTrait::setSection in core/modules/layout_builder/src/SectionListTrait.php
Sets the section for the given delta on the display.
SectionListTrait::__clone in core/modules/layout_builder/src/SectionListTrait.php
Magic method: Implements a deep clone.
5 methods override SectionListTrait::setSections()
LayoutBuilderEntityViewDisplay::setSections in core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php
Stores the information for all sections.
LayoutSectionItemList::setSections in core/modules/layout_builder/src/Field/LayoutSectionItemList.php
Stores the information for all sections.
NavigationSectionStorage::setSections in core/modules/navigation/src/Plugin/SectionStorage/NavigationSectionStorage.php
Stores the information for all sections.
SimpleConfigSectionStorage::setSections in core/modules/layout_builder/tests/modules/layout_builder_test/src/Plugin/SectionStorage/SimpleConfigSectionStorage.php
Stores the information for all sections.
TestSectionList::setSections in core/modules/layout_builder/tests/src/Kernel/SectionListTraitTest.php
Stores the information for all sections.

File

core/modules/layout_builder/src/SectionListTrait.php, line 23

Class

SectionListTrait
Provides a trait for maintaining a list of sections.

Namespace

Drupal\layout_builder

Code

protected abstract function setSections(array $sections);

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