/Drupal 8

function node_load_multiple

node_load_multiple(array $nids = NULL, $reset = FALSE)

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.

Return value

\Drupal\node\NodeInterface[] An array of node entities indexed by nid.


in Drupal 8.x, will be removed before Drupal 9.0. Use \Drupal\node\Entity\Node::loadMultiple().

See also




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


function node_load_multiple(array $nids = NULL, $reset = FALSE) {
  if ($reset) {
  return Node::loadMultiple($nids);

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.