function NavigationSectionStorage::setSections

Same name and namespace in other branches
  1. 11.x core/modules/navigation/src/Plugin/SectionStorage/NavigationSectionStorage.php \Drupal\navigation\Plugin\SectionStorage\NavigationSectionStorage::setSections()

Stores the information for all sections.

Implementations of this method are expected to call array_values() to rekey the list of sections.

Parameters

\Drupal\layout_builder\Section[] $sections: An array of section objects.

Return value

$this

Overrides SectionListTrait::setSections

1 call to NavigationSectionStorage::setSections()
NavigationSectionStorage::getSections in core/modules/navigation/src/Plugin/SectionStorage/NavigationSectionStorage.php
Gets the layout sections.

File

core/modules/navigation/src/Plugin/SectionStorage/NavigationSectionStorage.php, line 125

Class

NavigationSectionStorage
Provides navigation section storage.

Namespace

Drupal\navigation\Plugin\SectionStorage

Code

protected function setSections(array $sections) : static {
    $this->sections = array_values($sections);
    return $this;
}

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