You are here

function library_node_delete in Library 7

Implements hook_node_delete().

When a node is deleted, we need to remove all related records from the library.

File

./library.module, line 732

Code

function library_node_delete($node) {

  // Notice that we're deleting even if the content type is not in the library.
  db_delete('library')
    ->condition('nid', $node->nid)
    ->execute();
  db_delete('library_transactions')
    ->condition('nid', $node->nid)
    ->execute();
}