public function LayoutSectionItemList::getSections in Drupal 8
Same name and namespace in other branches
- 9 core/modules/layout_builder/src/Field/LayoutSectionItemList.php \Drupal\layout_builder\Field\LayoutSectionItemList::getSections()
- 10 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 a 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;
}