function SectionListTrait::getSection
Same name in other branches
- 9 core/modules/layout_builder/src/SectionListTrait.php \Drupal\layout_builder\SectionListTrait::getSection()
- 10 core/modules/layout_builder/src/SectionListTrait.php \Drupal\layout_builder\SectionListTrait::getSection()
1 call to SectionListTrait::getSection()
- LayoutBuilderEntityViewDisplay::getDefaultSection in core/
modules/ layout_builder/ src/ Entity/ LayoutBuilderEntityViewDisplay.php - Gets a default section.
File
-
core/
modules/ layout_builder/ src/ SectionListTrait.php, line 39
Class
- SectionListTrait
- Provides a trait for maintaining a list of sections.
Namespace
Drupal\layout_builderCode
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.