You are here

function recipe_delete in Recipe 7

Same name and namespace in other branches
  1. 5 recipe.module \recipe_delete()
  2. 6 recipe.module \recipe_delete()
  3. 7.2 recipe.module \recipe_delete()

Implements hook_delete().

When a node is deleted, delete the recipe and recipe node ingredient links. Leave the ingredients.

File

./recipe.module, line 290
Contains functions for Recipe node CRUD and display.

Code

function recipe_delete($node) {
  db_query("DELETE FROM {recipe} WHERE nid = :nid", array(
    ':nid' => $node->nid,
  ));
  db_query("DELETE FROM {recipe_node_ingredient} WHERE nid = :nid", array(
    ':nid' => $node->nid,
  ));
}