function Section::setComponent

Same name and namespace in other branches
  1. 9 core/modules/layout_builder/src/Section.php \Drupal\layout_builder\Section::setComponent()
  2. 10 core/modules/layout_builder/src/Section.php \Drupal\layout_builder\Section::setComponent()
  3. 11.x 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 191

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;
}

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