function LayoutBuilderEntityViewDisplay::setSections

Same name in other branches
  1. 8.9.x core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay::setSections()
  2. 10 core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay::setSections()
  3. 11.x core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay::setSections()

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\Entity

Code

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.