node_example_delete

Versions
4.6 – 7
node_example_delete($node)

Implementation of hook_delete().

When a node is deleted, we need to remove all related records from out table.

Code

developer/examples/node_example.module, line 199

<?php
function node_example_delete($node) {
  // Notice that we're matching all revision, by using the node's nid.
  db_query('DELETE FROM {node_example} WHERE nid = %d', $node->nid);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.