You are here

function deploy_plan_create in Deploy - Content Staging 7.2

Same name and namespace in other branches
  1. 7.3 deploy.module \deploy_plan_create()

Object factory for a deployment plan.

1 string reference to 'deploy_plan_create'
deploy_schema in ./deploy.install
Implements hook_schema().

File

./deploy.module, line 133
Deploy module functions.

Code

function deploy_plan_create($schema, $item) {
  $plan = new DeployPlan();

  // Unserialize our serialized params.
  foreach ($schema['fields'] as $field => $info) {
    if (!empty($info['serialize'])) {
      $plan->{$field} = unserialize($item->{$field});
    }
    else {
      $plan->{$field} = $item->{$field};
    }
  }
  return $plan;
}