You are here

public function BookManager::getParentDepthLimit in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 139
Contains \Drupal\book\BookManager.

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);
}