You are here

public function SectionListTrait::getSection in Drupal 10

Same name and namespace in other branches
  1. 9 core/modules/layout_builder/src/SectionListTrait.php \Drupal\layout_builder\SectionListTrait::getSection()
2 calls to SectionListTrait::getSection()
LayoutBuilderEntityViewDisplay::getDefaultRegion in core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php
Gets the default region.
LayoutBuilderEntityViewDisplay::getDefaultSection in core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php
Gets a default section.

File

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

Class

SectionListTrait
Provides a trait for maintaining a list of sections.

Namespace

Drupal\layout_builder

Code

public function getSection($delta) {
  if (!$this
    ->hasSection($delta)) {
    throw new \OutOfBoundsException(sprintf('Invalid delta "%s"', $delta));
  }
  return $this
    ->getSections()[$delta];
}