BookManager::flatBookTree

protected BookManager::flatBookTree(array $tree, array &$flat)

Recursively converts a tree of menu links to a flat array.

Parameters

array $tree: A tree of menu links in an array.

array $flat: A flat array of the menu links from $tree, passed by reference.

See also

static::bookTreeGetFlat()

File

core/modules/book/src/BookManager.php, line 725

Class

BookManager
Defines a book manager.

Namespace

Drupal\book

Code

protected function flatBookTree(array $tree, array &$flat) {
  foreach ($tree as $data) {
    $flat[$data['link']['nid']] = $data['link'];
    if ($data['below']) {
      $this->flatBookTree($data['below'], $flat);
    }
  }
}
doc_Drupal
2016-10-29 08:48:10
Comments
Leave a Comment

Please login to continue.