hook_update

  1. drupal
    1. 5 node.php
    2. 6 node.php
    3. 7
    4. 8
Versions
5 – 7 hook_update($node)

Respond to updates to a node.

This hook is invoked only on the module that defines the node's content type (use hook_node_update() to act on all node updates).

This hook is invoked from node_save() after the node is updated in the node table in the database, before field_attach_update() is called, and before hook_node_update() is invoked.

Parameters

$node The node that is being updated.

Related topics

Code

modules/node/node.api.php, line 1189

<?php
function hook_update($node) {
  db_update('mytable')
    ->fields(array('extra' => $node->extra))
    ->condition('nid', $node->nid)
    ->execute();
}
?>