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_builderCode
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,
];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.