node_load

5 node.module node_load($param = array(), $revision = NULL, $reset = NULL)
6 node.module node_load($param = array(), $revision = NULL, $reset = NULL)
7 node.module node_load($nid = NULL, $vid = NULL, $reset = FALSE)
8 node.module node_load($nid = NULL, $vid = NULL, $reset = FALSE)

Loads a node entity from the database.

Parameters

int $nid: (optional) The node ID.

int $vid: (optional) The revision ID.

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

Return value

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

73 calls to node_load()

File

core/modules/node/node.module, line 945
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;
}
Login or register to post comments