function SectionStorageBase::removeSection

Same name and namespace in other branches
  1. 9 core/modules/layout_builder/src/Plugin/SectionStorage/SectionStorageBase.php \Drupal\layout_builder\Plugin\SectionStorage\SectionStorageBase::removeSection()
  2. 8.9.x core/modules/layout_builder/src/Plugin/SectionStorage/SectionStorageBase.php \Drupal\layout_builder\Plugin\SectionStorage\SectionStorageBase::removeSection()
  3. 11.x core/modules/layout_builder/src/Plugin/SectionStorage/SectionStorageBase.php \Drupal\layout_builder\Plugin\SectionStorage\SectionStorageBase::removeSection()

Removes the section at the given delta.

As sections are stored sequentially and numerically this will re-key every subsequent section, shifting them forward.

Parameters

int $delta: The delta of the section.

Return value

$this

Overrides SectionListInterface::removeSection

File

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

Class

SectionStorageBase
Provides a base class for Section Storage types.

Namespace

Drupal\layout_builder\Plugin\SectionStorage

Code

public function removeSection($delta) {
  $this->getSectionList()
    ->removeSection($delta);
  return $this;
}

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