function hook_update

7.x node.api.php 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

48 functions implement hook_update()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

book_form_update in drupal/modules/book/book.module
Renders a new parent page select element when the book selection changes.
book_node_type_update in drupal/modules/book/book.module
Implements hook_node_type_update().
book_node_update in drupal/modules/book/book.module
Implements hook_node_update().
comment_node_type_update in drupal/modules/comment/comment.module
Implements hook_node_type_update().
dashboard_update in drupal/modules/dashboard/dashboard.module
Sets the new weight of each region according to the drag-and-drop order.

... See full list

3 invocations of hook_update()
field_attach_update in drupal/modules/field/field.attach.inc
Save field data for an existing entity.
update_check_requirements in drupal/update.php
Checks update requirements and reports errors and (optionally) warnings.
user_save in drupal/modules/user/user.module
Save changes to a user account or add a new user.

File

drupal/modules/node/node.api.php, line 1211
Hooks provided by the Node module.

Code

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