function Section::__construct

Same name and namespace in other branches
  1. 11.x core/modules/layout_builder/src/Section.php \Drupal\layout_builder\Section::__construct()
  2. 10 core/modules/layout_builder/src/Section.php \Drupal\layout_builder\Section::__construct()
  3. 9 core/modules/layout_builder/src/Section.php \Drupal\layout_builder\Section::__construct()
  4. 8.9.x core/modules/layout_builder/src/Section.php \Drupal\layout_builder\Section::__construct()

Constructs a new Section.

Parameters

string $layoutId: The layout plugin ID.

array $layoutSettings: (optional) The layout plugin settings.

\Drupal\layout_builder\SectionComponent[] $components: (optional) The components.

array[] $thirdPartySettings: (optional) Any third party settings.

File

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

Class

Section
Provides a domain object for layout sections.

Namespace

Drupal\layout_builder

Code

public function __construct(protected $layoutId, protected array $layoutSettings = [], array $components = [], protected array $thirdPartySettings = []) {
  foreach ($components as $component) {
    $this->setComponent($component);
  }
}

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