node_load_multiple

7 node.module node_load_multiple($nids = array(), $conditions = array(), $reset = FALSE)
8 node.module node_load_multiple($nids = array(), array $conditions = array(), $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.

@todo Remove $conditions in Drupal 8.

Parameters

array|bool $nids: (optional) An array of node IDs, or FALSE to load all nodes.

array $conditions: (deprecated) An associative array of conditions on the {node} table, where the keys are the database fields and the values are the values those fields must have. Instead, it is preferable to use EntityFieldQuery to retrieve a list of entity IDs loadable by this function.

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

Return value

array An array of node entities indexed by nid.

See also

entity_load_multiple()

EntityFieldQuery

12 calls to node_load_multiple()

File

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

Code

function node_load_multiple($nids = array(), array $conditions = array(), $reset = FALSE) {
  return entity_load_multiple('node', $nids, $conditions, $reset);
}
Login or register to post comments