You are here

protected function SectionStorageTrait::setSection in Drupal 8

Sets the section for the given delta on the display.

Parameters

int $delta: The delta of the section.

\Drupal\layout_builder\Section $section: The layout section.

Return value

$this

1 call to SectionStorageTrait::setSection()
SectionStorageTrait::appendSection in core/modules/layout_builder/src/SectionStorage/SectionStorageTrait.php

File

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

Class

SectionStorageTrait
Provides a trait for storing sections on an object.

Namespace

Drupal\layout_builder\SectionStorage

Code

protected function setSection($delta, Section $section) {
  $sections = $this
    ->getSections();
  $sections[$delta] = $section;
  $this
    ->setSections($sections);
  return $this;
}