function Section::__construct

Same name and namespace in other branches
  1. 8.9.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. 11.x core/modules/layout_builder/src/Section.php \Drupal\layout_builder\Section::__construct()

Constructs a new Section.

Parameters

string $layout_id: The layout plugin ID.

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

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

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

File

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

Class

Section
Provides a domain object for layout sections.

Namespace

Drupal\layout_builder

Code

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

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