You are here

public function SectionStorageBase::insertSection in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/layout_builder/src/Plugin/SectionStorage/SectionStorageBase.php \Drupal\layout_builder\Plugin\SectionStorage\SectionStorageBase::insertSection()
  2. 10 core/modules/layout_builder/src/Plugin/SectionStorage/SectionStorageBase.php \Drupal\layout_builder\Plugin\SectionStorage\SectionStorageBase::insertSection()

Inserts a new section at a given delta.

If a section exists at the given index, the section at that position and others after it are shifted backward.

Parameters

int $delta: The delta of the section.

\Drupal\layout_builder\Section $section: The section to insert.

Return value

$this

Overrides SectionListInterface::insertSection

File

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

Class

SectionStorageBase
Provides a base class for Section Storage types.

Namespace

Drupal\layout_builder\Plugin\SectionStorage

Code

public function insertSection($delta, Section $section) {
  $this
    ->getSectionList()
    ->insertSection($delta, $section);
  return $this;
}