function recipe_populate_units in Recipe 6
Same name and namespace in other branches
- 5 recipe.install \recipe_populate_units()
Load the recipe_units table.
1 call to recipe_populate_units()
- recipe_install in ./
recipe.install - Implementation of hook_install().
File
- ./
recipe.install, line 234 - Install, update and uninstall functions for the recipe module.
Code
function recipe_populate_units() {
$s = TRUE;
$units = get_default_units();
foreach ($units as $u) {
$s = $s && db_query("INSERT INTO {recipe_unit} (name, abbreviation, metric, type, aliases) VALUES ('%s', '%s', %d, '%s', '%s')", $u['name'], $u['abbreviation'], $u['metric'], $u['type'], $u['aliases']);
}
return $s;
}