function recipe_node_update in Recipe 7.2
Same name and namespace in other branches
- 7 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 129 - 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)),
));
}
}