public function BookManager::getParentDepthLimit in Drupal 9
Same name and namespace in other branches
- 8 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 207
Class
- BookManager
- Defines a book manager.
Namespace
Drupal\bookCode
public function getParentDepthLimit(array $book_link) {
return static::BOOK_MAX_DEPTH - 1 - ($book_link['bid'] && $book_link['has_children'] ? $this
->findChildrenRelativeDepth($book_link) : 0);
}