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: Whether access checking should be taken into account.

Return value

array Array of loaded book items.

Overrides BookOutlineStorageInterface::loadMultiple

File

core/modules/book/src/BookOutlineStorage.php, line 45

Class

BookOutlineStorage
Defines a storage class for books outline.

Namespace

Drupal\book

Code

public function loadMultiple($nids, $access = TRUE) {
  $query = $this->connection->select('book', 'b', array('fetch' => \PDO::FETCH_ASSOC));
  $query->fields('b');
  $query->condition('b.nid', $nids, 'IN');

  if ($access) {
    $query->addTag('node_access');
    $query->addMetaData('base_table', 'book');
  }

  return $query->execute();
}
doc_Drupal
2016-10-29 08:48:25
Comments
Leave a Comment

Please login to continue.