function SectionStorageTrait::removeAllSections

3 calls to SectionStorageTrait::removeAllSections()
LayoutBuilderEntityViewDisplay::preSave in core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php
Acts on an entity before the presave hook is invoked.
SectionStorageTrait::insertSection in core/modules/layout_builder/src/SectionStorage/SectionStorageTrait.php
SectionStorageTrait::removeSection in core/modules/layout_builder/src/SectionStorage/SectionStorageTrait.php

File

core/modules/layout_builder/src/SectionStorage/SectionStorageTrait.php, line 151

Class

SectionStorageTrait
Provides a trait for storing sections on an object.

Namespace

Drupal\layout_builder\SectionStorage

Code

public function removeAllSections($set_blank = FALSE) {
    $this->setSections([]);
    if ($set_blank) {
        $this->addBlankSection();
    }
    return $this;
}

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