You are here

function farm_livestock_update_7005 in farmOS 7

Create group assets for each animal group term, assign animals to new group assets, convert egg logs to harvest logs, and remove old animal groups taxonomy and related features.

File

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

Code

function farm_livestock_update_7005(&$sandbox) {

  // This is a multi-stage update.
  // We use the $sandbox['stage'] variable to remember what stage we are on.
  // Start with stage 1.
  if (!isset($sandbox['stage'])) {
    $sandbox['stage'] = 1;
  }

  // Stage 1: Prepare.
  _farm_livestock_update_7005_stage1($sandbox);

  // Stage 2: Create group assets for each animal group term.
  _farm_livestock_update_7005_stage2($sandbox);

  // Stage 3: Assign animals to new group assets.
  _farm_livestock_update_7005_stage3($sandbox);

  // Stage 4: Convert egg logs to harvest logs.
  _farm_livestock_update_7005_stage4($sandbox);

  // Stage 5: Clean up.
  _farm_livestock_update_7005_stage5($sandbox);
}