BookManager::updateOriginalParent

protected BookManager::updateOriginalParent(array $original) Updates the has_children flag of the parent of the original node. This method is called when a book link is moved or deleted. So we want to update the has_children flag of the parent node. Parameters array $original: The original link whose parent we want to update. Return value bool TRUE if the update was successful (either there was no original parent to update, or the original parent was updated successfully), FALSE on failure. F

BookManager::setParents

protected BookManager::setParents(array &$link, array $parent) Sets the p1 through p9 properties for a book link being saved. Parameters array $link: The book link to update, passed by reference. array $parent: The parent values to set. File core/modules/book/src/BookManager.php, line 911 Class BookManager Defines a book manager. Namespace Drupal\book Code protected function setParents(array &$link, array $parent) { $i = 1; while ($i < $link['depth']) { $p = 'p' . $

BookManager::saveBookLink

public BookManager::saveBookLink(array $link, $new) Saves a single book entry. Parameters array $link: The link data to save. bool $new: Is this a new book. Return value array The book data of that node. Overrides BookManagerInterface::saveBookLink File core/modules/book/src/BookManager.php, line 761 Class BookManager Defines a book manager. Namespace Drupal\book Code public function saveBookLink(array $link, $new) { // Keep track of Book IDs for cache clear. $affected_bids[$link

BookManager::recurseTableOfContents

protected BookManager::recurseTableOfContents(array $tree, $indent, array &$toc, array $exclude, $depth_limit) Recursively processes and formats book links for getTableOfContents(). This helper function recursively modifies the table of contents array for each item in the book tree, ignoring items in the exclude array or at a depth greater than the limit. Truncates titles over thirty characters and appends an indentation string incremented by depth. Parameters array $tree: The data structu

BookManager::moveChildren

protected BookManager::moveChildren(array $link, array $original) Moves children from the original parent to the updated link. Parameters array $link: The link being saved. array $original: The original parent of $link. File core/modules/book/src/BookManager.php, line 826 Class BookManager Defines a book manager. Namespace Drupal\book Code protected function moveChildren(array $link, array $original) { $p = 'p1'; $expressions = array(); for ($i = 1; $i <= $link['depth']; $p =

BookManager::loadBooks

protected BookManager::loadBooks() Loads Books Array. File core/modules/book/src/BookManager.php, line 94 Class BookManager Defines a book manager. Namespace Drupal\book Code protected function loadBooks() { $this->books = array(); $nids = $this->bookOutlineStorage->getBooks(); if ($nids) { $book_links = $this->bookOutlineStorage->loadMultiple($nids); $nodes = $this->entityManager->getStorage('node')->loadMultiple($nids); // @todo: Sort by wei

BookManager::loadBookLinks

public BookManager::loadBookLinks($nids, $translate = TRUE) Loads multiple book entries. The entries of a book entry is documented in \Drupal\book\BookOutlineStorageInterface::loadMultiple. If $translate is TRUE, it also checks access ('access' key) and loads the title from the node itself. Parameters int[] $nids: An array of nids to load. bool $translate: If TRUE, set access, title, and other elements. Return value array[] The book data of each node keyed by NID. Overrides BookManagerInterfa

BookManager::loadBookLink

public BookManager::loadBookLink($nid, $translate = TRUE) Loads a single book entry. The entries of a book entry is documented in \Drupal\book\BookOutlineStorageInterface::loadMultiple. If $translate is TRUE, it also checks access ('access' key) and loads the title from the node itself. Parameters int $nid: The node ID of the book. bool $translate: If TRUE, set access, title, and other elements. Return value array The book data of that node. Overrides BookManagerInterface::loadBookLink See al

BookManager::getTableOfContents

public BookManager::getTableOfContents($bid, $depth_limit, array $exclude = array()) Returns an array of book pages in table of contents order. Parameters int $bid: The ID of the book whose pages are to be listed. int $depth_limit: Any link deeper than this value will be excluded (along with its children). array $exclude: (optional) An array of menu link ID values. Any link whose menu link ID is in this array will be excluded (along with its children). Defaults to an empty array. Return value

BookManager::getParentDepthLimit

public BookManager::getParentDepthLimit(array $book_link) 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 134 Class BookManager Defines a book manager. Namespace Drupal\book Code public function getParentDepthLimit(array $book