BookOutlineStorageInterface

Defines a common interface for book outline storage classes. Hierarchy interface \Drupal\book\BookOutlineStorageInterface File core/modules/book/src/BookOutlineStorageInterface.php, line 8 Namespace Drupal\book Members Name Modifiers Type Description BookOutlineStorageInterface::countOriginalLinkChildren public function Count the number of original link children. BookOutlineStorageInterface::delete public function Deletes a book entry. BookOutlineStorageInterfa

BookOutlineStorage::loadMultiple

public BookOutlineStorage::loadMultiple($nids, $access = TRUE) Loads books. Each book entry consists of the following keys: bid: The node ID of the main book. nid: The node ID of the book entry itself. pid: The parent node ID of the book. has_children: A boolean to indicate whether the book has children. weight: The weight of the book entry to order siblings. depth: The depth in the menu hierarchy the entry is placed into. Parameters array $nids: An array of node IDs. bool $access: Whe

BookOutlineStorage::hasBooks

public BookOutlineStorage::hasBooks() Checks if there are any books. Return value bool TRUE if there are books, FALSE if not. Overrides BookOutlineStorageInterface::hasBooks File core/modules/book/src/BookOutlineStorage.php, line 36 Class BookOutlineStorage Defines a storage class for books outline. Namespace Drupal\book Code public function hasBooks() { return (bool) $this->connection ->query('SELECT count(bid) FROM {book}') ->fetchField(); }

BookOutlineStorage::loadBookChildren

public BookOutlineStorage::loadBookChildren($pid) Loads book's children using it's parent ID. Parameters int $pid: The book's parent ID. Return value array Array of loaded book items. Overrides BookOutlineStorageInterface::loadBookChildren File core/modules/book/src/BookOutlineStorage.php, line 90 Class BookOutlineStorage Defines a storage class for books outline. Namespace Drupal\book Code public function loadBookChildren($pid) { return $this->connection ->query("SELECT

BookOutlineStorage::updateMovedChildren

public BookOutlineStorage::updateMovedChildren($bid, $original, $expressions, $shift) Update the book ID of the book link that it's being moved. Parameters int $bid: The ID of the book whose children we move. array $original: The original parent of the book link. array $expressions: Array of expressions to be added to the query. int $shift: The difference in depth between the old and the new position of the element being moved. Return value mixed The number of rows matched by the update query

BookOutlineStorage::update

public BookOutlineStorage::update($nid, $fields) Updates book reference for links that were moved between books. Parameters int $nid: The nid of the book entry to be updated. array $fields: The array of fields to be updated. Return value mixed The number of rows matched by the update query. Overrides BookOutlineStorageInterface::update File core/modules/book/src/BookOutlineStorage.php, line 144 Class BookOutlineStorage Defines a storage class for books outline. Namespace Drupal\book

BookOutlineStorage::getChildRelativeDepth

public BookOutlineStorage::getChildRelativeDepth($book_link, $max_depth) Gets child relative depth. Parameters array $book_link: The book link. int $max_depth: The maximum supported depth of the book tree. Return value int The depth of the searched book. Overrides BookOutlineStorageInterface::getChildRelativeDepth File core/modules/book/src/BookOutlineStorage.php, line 61 Class BookOutlineStorage Defines a storage class for books outline. Namespace Drupal\book Code public function ge

BookOutlineStorage::insert

public BookOutlineStorage::insert($link, $parents) Inserts a book link. Parameters array $link: The link array to be inserted in the database. array $parents: The array of parent ids for the link to be inserted. Return value mixed The last insert ID of the query, if one exists. Overrides BookOutlineStorageInterface::insert File core/modules/book/src/BookOutlineStorage.php, line 128 Class BookOutlineStorage Defines a storage class for books outline. Namespace Drupal\book Code public f

BookOutlineStorage::countOriginalLinkChildren

public BookOutlineStorage::countOriginalLinkChildren($original) Count the number of original link children. Parameters array $original: The book link array. Return value int Number of children. Overrides BookOutlineStorageInterface::countOriginalLinkChildren File core/modules/book/src/BookOutlineStorage.php, line 176 Class BookOutlineStorage Defines a storage class for books outline. Namespace Drupal\book Code public function countOriginalLinkChildren($original) { return $this->

BookOutlineStorage::delete

public BookOutlineStorage::delete($nid) Deletes a book entry. Parameters int $nid: Deletes a book entry. Return value mixed Number of deleted book entries. Overrides BookOutlineStorageInterface::delete File core/modules/book/src/BookOutlineStorage.php, line 81 Class BookOutlineStorage Defines a storage class for books outline. Namespace Drupal\book Code public function delete($nid) { return $this->connection->delete('book') ->condition('nid', $nid) ->execute();