You are here

public function SectionStorageTrait::getSection in Drupal 8

1 call to SectionStorageTrait::getSection()
LayoutBuilderEntityViewDisplay::getDefaultSection in core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php
Gets a default section.

File

core/modules/layout_builder/src/SectionStorage/SectionStorageTrait.php, line 39

Class

SectionStorageTrait
Provides a trait for storing sections on an object.

Namespace

Drupal\layout_builder\SectionStorage

Code

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