You are here

function _deploy_auto_plan_entity_save in Deploy - Content Staging 7.3

Same name and namespace in other branches
  1. 7.2 modules/deploy_auto_plan/deploy_auto_plan.module \_deploy_auto_plan_entity_save()

Handles an entity being saved.

Parameters

$entity: The entity object.

$type: The type of entity being updated (i.e. node, user, comment).

2 calls to _deploy_auto_plan_entity_save()
deploy_auto_plan_entity_insert in modules/deploy_auto_plan/deploy_auto_plan.module
Implements hook_entity_insert().
deploy_auto_plan_entity_update in modules/deploy_auto_plan/deploy_auto_plan.module
Implements hook_entity_update().

File

modules/deploy_auto_plan/deploy_auto_plan.module, line 145
Deploy Auto Plan module functions.

Code

function _deploy_auto_plan_entity_save($entity, $type) {
  $plan_name = deploy_auto_plan_get_plan();
  $info = entity_get_info($type);
  if (!$plan_name || empty($info['entity keys']['uuid'])) {

    // we only care about entities with UUIDs.
    return;
  }

  // Allow other modules to alter whether or not the entity should be added.
  $status = TRUE;
  drupal_alter('deploy_auto_plan_status', $status, $type, $entity);
  if (!$status) {

    // If status is FALSE then don't add the entity to the plan.
    return;
  }
  deploy_manager_add_to_plan($plan_name, $type, $entity);
}