You are here

function deploy_services_diff_plan in Deploy - Content Staging 7.2

Same name and namespace in other branches
  1. 7.3 modules/deploy_services/deploy_services.services.inc \deploy_services_diff_plan()

Services targeted action to show diff of all entities of a plan

Parameters

string $plan_name: The name of the plan to diff.

Return value

array A list of all entities diffed from the given deploy plan.

1 string reference to 'deploy_services_diff_plan'
deploy_services_services_resources in modules/deploy_services/deploy_services.services.inc
Implements hook_services_resources().

File

modules/deploy_services/deploy_services.services.inc, line 224
Deploy Services module services functions.

Code

function deploy_services_diff_plan($plan_name) {
  $diffs = array();
  $plan = deploy_plan_load($plan_name);

  // TODO handle plan not being found - need to return a 404.
  $entities = deploy_manager_get_entities($plan->name);
  foreach ($entities as $entity) {
    $diffs["{$entity['type']}-{$entity['id']}-{$entity['revision_id']}"] = deploy_services_diff_entity($entity['type'], $entity['id'], $entity['revision_id']);
  }
  return $diffs;
}