You are here

public function BookManager::loadBookLink in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/book/src/BookManager.php \Drupal\book\BookManager::loadBookLink()

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 also

\Drupal\book\BookOutlineStorageInterface::loadMultiple

3 calls to BookManager::loadBookLink()
BookManager::deleteFromBook in core/modules/book/src/BookManager.php
Deletes node's entry from book table.
BookManager::saveBookLink in core/modules/book/src/BookManager.php
Saves a single book entry.
BookManager::updateOutline in core/modules/book/src/BookManager.php
Handles additions and updates to the book outline.

File

core/modules/book/src/BookManager.php, line 821

Class

BookManager
Defines a book manager.

Namespace

Drupal\book

Code

public function loadBookLink($nid, $translate = TRUE) {
  $links = $this
    ->loadBookLinks([
    $nid,
  ], $translate);
  return isset($links[$nid]) ? $links[$nid] : FALSE;
}