You are here

function recipe_node_update in Recipe 7

Same name and namespace in other branches
  1. 7.2 recipe.module \recipe_node_update()

Implements hook_node_update().

This enables the ingredient node feature. If there is an ingredient with the same name as a node type ingredient, link them.

1 call to recipe_node_update()
recipe_node_insert in ./recipe.module
Implements hook_node_insert().

File

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

Code

function recipe_node_update($node) {
  if ($node->type == 'ingredient') {
    db_query("UPDATE {recipe_ingredient} SET link = :link WHERE LOWER(name) = :name", array(
      ':link' => $node->nid,
      ':name' => trim(strtolower($node->title)),
    ));
  }
}