Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Section.php

function Section::toArray

Returns an array representation of the section.

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/Section.php, line 355

Class

Section
Provides a domain object for layout sections.

Namespace

Drupal\layout_builder

Code

public function toArray() {
    return [
        'layout_id' => $this->getLayoutId(),
        'layout_settings' => $this->getLayoutSettings(),
        'components' => array_map(function (SectionComponent $component) {
            return $component->toArray();
        }, $this->getComponents()),
        'third_party_settings' => $this->thirdPartySettings,
    ];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal