You are here

public function SectionStorageBase::removeAllSections in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/src/Plugin/SectionStorage/SectionStorageBase.php \Drupal\layout_builder\Plugin\SectionStorage\SectionStorageBase::removeAllSections()

Removes all of the sections.

Parameters

bool $set_blank: (optional) The default implementation of section lists differentiates between a list that has never contained any sections and a list that has purposefully had all sections removed in order to remain blank. Passing TRUE will mirror ::removeSection() by tracking this as a blank list. Passing FALSE will reset the list as though it had never contained any sections at all. Defaults to FALSE.

Return value

$this

Overrides SectionListInterface::removeAllSections

File

core/modules/layout_builder/src/Plugin/SectionStorage/SectionStorageBase.php, line 86

Class

SectionStorageBase
Provides a base class for Section Storage types.

Namespace

Drupal\layout_builder\Plugin\SectionStorage

Code

public function removeAllSections($set_blank = FALSE) {
  $this
    ->getSectionList()
    ->removeAllSections($set_blank);
  return $this;
}