BookOutlineStorage
class BookOutlineStorage implements BookOutlineStorageInterface (View source)
Defines a storage class for books outline.
Properties
| protected Connection | $connection | Database Service Object. |
Methods
Gets books (the highest positioned book links).
Checks if there are any books.
Loads books.
Gets child relative depth.
Deletes a book entry.
Loads book's children using its parent ID.
Builds tree data used for the menu tree.
Inserts a book link.
Updates book reference for links that were moved between books.
Update the book ID of the book link that it's being moved.
Count the number of original link children.
Get book subtree.
Details
__construct(Connection $connection)
Constructs a BookOutlineStorage object.
array
getBooks()
Gets books (the highest positioned book links).
bool
hasBooks()
Checks if there are any books.
array
loadMultiple(array $nids, bool $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.
int
getChildRelativeDepth(array $book_link, int $max_depth)
Gets child relative depth.
mixed
delete(int $nid)
Deletes a book entry.
array
loadBookChildren(int $pid)
Loads book's children using its parent ID.
array
getBookMenuTree(int $bid, array $parameters, int $min_depth, int $max_depth)
Builds tree data used for the menu tree.
mixed
insert(array $link, array $parents)
Inserts a book link.
mixed
update(int $nid, array $fields)
Updates book reference for links that were moved between books.
mixed
updateMovedChildren(int $bid, array $original, array $expressions, int $shift)
Update the book ID of the book link that it's being moved.
int
countOriginalLinkChildren(array $original)
Count the number of original link children.
array
getBookSubtree(array $link, int $max_depth)
Get book subtree.