node_tag_new

5 node.module node_tag_new($nid)
6 node.module node_tag_new($nid)
7 node.module node_tag_new($node)
8 node.module node_tag_new(Node $node)

Updates the 'last viewed' timestamp of the specified node for current user.

Parameters

Drupal\node\Node $node: A node entity.

1 call to node_tag_new()

File

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

Code

function node_tag_new(Node $node) {
  global $user;
  if ($user->uid) {
    db_merge('history')
      ->key(array(
      'uid' => $user->uid, 
      'nid' => $node->nid,
    ))
      ->fields(array('timestamp' => REQUEST_TIME))
      ->execute();
  }
}
Login or register to post comments