public function SectionListTrait::getSection in Drupal 9
Same name and namespace in other branches
- 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];
}