function LayoutSectionItemList::preSave
Overrides FieldItemList::preSave
File
- 
              core/
modules/ layout_builder/ src/ Field/ LayoutSectionItemList.php, line 72  
Class
- LayoutSectionItemList
 - Defines an item list class for layout section fields.
 
Namespace
Drupal\layout_builder\FieldCode
public function preSave() {
  parent::preSave();
  // Loop through each section and reconstruct it to ensure that all default
  // values are present.
  foreach ($this->list as $item) {
    $item->section = Section::fromArray($item->section
      ->toArray());
  }
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.