You are here

function farm_livestock_update_7004 in farmOS 7

Enable inventory tracking for animal assets.

File

modules/farm/farm_livestock/farm_livestock.install, line 100
Farm livestock install file.

Code

function farm_livestock_update_7004(&$sandbox) {

  // Load the animal asset type.
  $asset_type = farm_asset_type_load('animal');

  // Add the inventory settings.
  $asset_type->inventory = array(
    'type' => 'animal',
    'enabled' => TRUE,
    'individual' => TRUE,
  );

  // Save the asset type.
  farm_asset_type_save($asset_type);
}