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
1 2 3 4 5 6 7 8 | 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 ); } } } |
Please login to continue.