You are here

public function LayoutSectionItemList::getSections in Drupal 10

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

Code

public function getSections() {
  $sections = [];
  foreach ($this->list as $delta => $item) {
    $sections[$delta] = $item->section;
  }
  return $sections;
}