You are here

public function SectionComponent::toArray in Drupal 8

Same name and namespace in other branches
  1. 9 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(),
    'additional' => $this->additional,
    'weight' => $this
      ->getWeight(),
  ];
}