function SectionStorageTrait::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 SectionStorageTrait::setSections()
SectionStorageTrait::insertSection in core/modules/layout_builder/src/SectionStorage/SectionStorageTrait.php
SectionStorageTrait::removeAllSections in core/modules/layout_builder/src/SectionStorage/SectionStorageTrait.php
SectionStorageTrait::removeSection in core/modules/layout_builder/src/SectionStorage/SectionStorageTrait.php
SectionStorageTrait::setSection in core/modules/layout_builder/src/SectionStorage/SectionStorageTrait.php
Sets the section for the given delta on the display.
SectionStorageTrait::__clone in core/modules/layout_builder/src/SectionStorage/SectionStorageTrait.php
Magic method: Implements a deep clone.
4 methods override SectionStorageTrait::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.
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/SectionStorage/SectionStorageTrait.php, line 23

Class

SectionStorageTrait
Provides a trait for storing sections on an object.

Namespace

Drupal\layout_builder\SectionStorage

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.