function LayoutBuilderEntityViewDisplay::setSections
Same name and namespace in other branches
- 8.9.x core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay::setSections()
- 10 core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay::setSections()
- 11.x core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay::setSections()
Stores the information for all sections.
Implementations of this method are expected to call array_values() to rekey the list of sections.
Parameters
\Drupal\layout_builder\Section[] $sections: An array of section objects.
Return value
$this
Overrides SectionListTrait::setSections
File
-
core/
modules/ layout_builder/ src/ Entity/ LayoutBuilderEntityViewDisplay.php, line 109
Class
- LayoutBuilderEntityViewDisplay
- Provides an entity view display entity that has a layout.
Namespace
Drupal\layout_builder\EntityCode
protected function setSections(array $sections) {
// Third-party settings must be completely unset instead of stored as an
// empty array.
if (!$sections) {
$this->unsetThirdPartySetting('layout_builder', 'sections');
}
else {
$this->setThirdPartySetting('layout_builder', 'sections', array_values($sections));
}
return $this;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.