function BookManager::getActiveTrailIds

File

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

Class

BookManager
Defines a book manager.

Namespace

Drupal\book

Code

public function getActiveTrailIds($bid, $link) {
  // The tree is for a single item, so we need to match the values in its
  // p columns and 0 (the top level) with the plid values of other links.
  $active_trail = [
    0,
  ];
  for ($i = 1; $i < static::BOOK_MAX_DEPTH; $i++) {
    if (!empty($link["p{$i}"])) {
      $active_trail[] = $link["p{$i}"];
    }
  }
  return $active_trail;
}

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