function BookManager::bookTreeGetFlat

Same name in other branches
  1. 9 core/modules/book/src/BookManager.php \Drupal\book\BookManager::bookTreeGetFlat()
  2. 10 core/modules/book/src/ProxyClass/BookManager.php \Drupal\book\ProxyClass\BookManager::bookTreeGetFlat()
  3. 10 core/modules/book/src/BookManager.php \Drupal\book\BookManager::bookTreeGetFlat()
  4. 11.x core/modules/book/src/ProxyClass/BookManager.php \Drupal\book\ProxyClass\BookManager::bookTreeGetFlat()
  5. 11.x core/modules/book/src/BookManager.php \Drupal\book\BookManager::bookTreeGetFlat()

Overrides BookManagerInterface::bookTreeGetFlat

File

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

Class

BookManager
Defines a book manager.

Namespace

Drupal\book

Code

public function bookTreeGetFlat(array $book_link) {
    if (!isset($this->bookTreeFlattened[$book_link['nid']])) {
        // Call $this->bookTreeAllData() to take advantage of caching.
        $tree = $this->bookTreeAllData($book_link['bid'], $book_link, $book_link['depth'] + 1);
        $this->bookTreeFlattened[$book_link['nid']] = [];
        $this->flatBookTree($tree, $this->bookTreeFlattened[$book_link['nid']]);
    }
    return $this->bookTreeFlattened[$book_link['nid']];
}

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