You are here

function _recipe_populate_units in Recipe 7.2

Same name and namespace in other branches
  1. 7 recipe.install \_recipe_populate_units()

Loads the recipe_units table.

File

./recipe.install, line 159
Install, update and uninstall functions for the recipe module.

Code

function _recipe_populate_units() {
  $units = _recipe_get_default_units();
  foreach ($units as $u) {
    db_insert('recipe_unit')
      ->fields(array(
      'name' => $u['name'],
      'abbreviation' => $u['abbreviation'],
      'metric' => $u['metric'],
      'type' => $u['type'],
      'aliases' => $u['aliases'],
    ))
      ->execute();
  }
  return TRUE;
}