8.2.x node.module node_load($nid = NULL, $reset = FALSE)
8.0.x node.module node_load($nid = NULL, $reset = FALSE)
8.1.x node.module node_load($nid = NULL, $reset = FALSE)
8.3.x node.module node_load($nid = NULL, $reset = FALSE)
4.6.x node.module node_load($conditions, $revision = NULL, $reset = NULL)
4.7.x node.module node_load($param = array(), $revision = NULL, $reset = NULL)
5.x node.module node_load($param = array(), $revision = NULL, $reset = NULL)
6.x node.module node_load($param = array(), $revision = NULL, $reset = NULL)
7.x node.module node_load($nid = NULL, $vid = NULL, $reset = FALSE)

Loads a node entity from the database.


int $nid: The node ID.

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

Return value

\Drupal\node\NodeInterface|null A fully-populated node entity, or NULL if the node is not found.


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


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


function node_load($nid = NULL, $reset = FALSE) {
  if ($reset) {
  return Node::load($nid);


orb’s picture

Node load in Drupal8:

$node = \Drupal\node\Entity\Node::load(1);

Debug output with Devel module

Andy_D’s picture

Personally I'd avoid static classes and go with something like:

use Drupal\node\Entity\Node;

class foo extends ControllerBase {

  public function bar($nid) {
    if (!empty($nid)) {
      $node = Node::load($nid);
      // the rest of your code here