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.
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.
array An array of node entities indexed by nid.
Drupal\Core\Entity\Query\EntityQueryInterface
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;
}