function node_load_multiple

Loads node entities from the database.

This function should be used whenever you need to load more than one node from the database. Nodes are loaded into memory and will not require database access if loaded again during the same page request.

Parameters

array $nids: (optional) An array of entity IDs. If omitted, all entities are loaded.

bool $reset: (optional) Whether to reset the internal node_load() cache. Defaults to FALSE.

Return value

array An array of node entities indexed by nid.

See also

entity_load_multiple()

Drupal\Core\Entity\Query\EntityQueryInterface

15 calls to node_load_multiple()
CommentRenderController::buildContent in drupal/core/modules/comment/lib/Drupal/comment/CommentRenderController.php
Overrides Drupal\Core\Entity\EntityRenderController::buildContent().
comment_admin_overview in drupal/core/modules/comment/comment.admin.inc
Form constructor for the comment overview administration form.
forum_get_topics in drupal/core/modules/forum/forum.module
Gets all the topics in a forum.
Nid::titleQuery in drupal/core/modules/node/lib/Drupal/node/Plugin/views/argument/Nid.php
Override the behavior of title(). Get the title of the node.
Node::validateArgument in drupal/core/modules/node/lib/Drupal/node/Plugin/views/argument_validator/Node.php

... See full list

File

drupal/core/modules/node/node.module, line 913
The core module that allows content to be submitted to the site.

Code

function node_load_multiple(array $nids = NULL, $reset = FALSE) {
  $entities = entity_load_multiple('node', $nids, $reset);

  // Return BC-entities.
  foreach ($entities as $id => $entity) {
    $entities[$id] = $entity
      ->getBCEntity();
  }
  return $entities;
}