public function LayoutSectionItemList::getSections in Drupal 9
Same name and namespace in other branches
- 8 core/modules/layout_builder/src/Field/LayoutSectionItemList.php \Drupal\layout_builder\Field\LayoutSectionItemList::getSections()
Gets the layout sections.
Return value
\Drupal\layout_builder\Section[] A sequentially and numerically keyed array of section objects.
Overrides SectionListInterface::getSections
File
- core/
modules/ layout_builder/ src/ Field/ LayoutSectionItemList.php, line 35
Class
- LayoutSectionItemList
- Defines an item list class for layout section fields.
Namespace
Drupal\layout_builder\FieldCode
public function getSections() {
$sections = [];
foreach ($this->list as $delta => $item) {
$sections[$delta] = $item->section;
}
return $sections;
}