hook_update
- Versions
- 4.6 – 6
hook_update($node)- 7
hook_update(stdClass $node)
Respond to node updating.
This is a hook used by node modules. It is called to allow the module to take action when an edited node is being updated in the database by, for example, updating information in related tables.
To take action when nodes of any type are updated (not just nodes of the type(s) defined by this module), use hook_node() instead.
For a detailed usage example, see node_example.module.
Parameters
$node The node being updated.
Related topics
Code
modules/node/node.api.php, line 893
<?php
function hook_update(stdClass $node) {
db_update('mytable')
->fields(array('extra' => $node->extra))
->condition('nid', $node->nid)
->execute();
}
?>Login or register to post comments 