You are here

public function BookManager::getParentDepthLimit in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/book/src/BookManager.php \Drupal\book\BookManager::getParentDepthLimit()

Finds the depth limit for items in the parent select.

Parameters

array $book_link: A fully loaded menu link that is part of the book hierarchy.

Return value

int The depth limit for items in the parent select.

Overrides BookManagerInterface::getParentDepthLimit

File

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

Class

BookManager
Defines a book manager.

Namespace

Drupal\book

Code

public function getParentDepthLimit(array $book_link) {
  return static::BOOK_MAX_DEPTH - 1 - ($book_link['bid'] && $book_link['has_children'] ? $this
    ->findChildrenRelativeDepth($book_link) : 0);
}