You are here

protected function Section::setComponent in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/src/Section.php \Drupal\layout_builder\Section::setComponent()

Helper method to set a component.

Parameters

\Drupal\layout_builder\SectionComponent $component: The component.

Return value

$this

3 calls to Section::setComponent()
Section::appendComponent in core/modules/layout_builder/src/Section.php
Appends a component to the end of a region.
Section::insertComponent in core/modules/layout_builder/src/Section.php
Inserts a component at a specified delta.
Section::__construct in core/modules/layout_builder/src/Section.php
Constructs a new Section.

File

core/modules/layout_builder/src/Section.php, line 198

Class

Section
Provides a domain object for layout sections.

Namespace

Drupal\layout_builder

Code

protected function setComponent(SectionComponent $component) {
  $this->components[$component
    ->getUuid()] = $component;
  return $this;
}