function SectionComponent::toArray

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

Returns an array representation of the section component.

Only use this method if you are implementing custom storage for sections.

Return value

array An array representation of the section component.

File

core/modules/layout_builder/src/SectionComponent.php, line 290

Class

SectionComponent
Provides a value object for a section component.

Namespace

Drupal\layout_builder

Code

public function toArray() {
    return [
        'uuid' => $this->getUuid(),
        'region' => $this->getRegion(),
        'configuration' => $this->getConfiguration(),
        'weight' => $this->getWeight(),
        'additional' => $this->additional,
    ];
}

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