1 node.module node_load($nid = NULL, $vid = NULL, $reset = FALSE)

Loads a node entity from the database.

Parameters

$nid: (optional) The node ID.

$vid: (optional) The revision ID.

$reset: (optional) Whether to reset the node_load_multiple() cache.

Return value

Node|false: A fully-populated node entity, or FALSE if the node is not found.

File

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

Code

function node_load($nid = NULL, $vid = NULL, $reset = FALSE) {
  $nids = (isset($nid) ? array($nid) : array());
  $conditions = (isset($vid) ? array('vid' => $vid) : array());
  $node = node_load_multiple($nids, $conditions, $reset);
  return $node ? reset($node) : FALSE;
}