function SectionStorageTrait::getSection

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];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.