You are here

function deploy_manager_add_to_plan in Deploy - Content Staging 7.2

Same name and namespace in other branches
  1. 7.3 deploy.manager.inc \deploy_manager_add_to_plan()

Adds an entity to a managed deployment plan.

Parameters

$plan_name: The machine name of the plan to add to.

$entity_type: The entity type to be deployed.

$entity: The entity to be deployed.

6 calls to deploy_manager_add_to_plan()
DeployWebTestCase::runScenario in ./deploy.test
This method runs a deployment scenario where we have one production site (the endpoint) and a staging site (the origin).
deploy_adhoc_plan_rules_action_add_to_managed_plan in modules/deploy_adhoc_plan/deploy_adhoc_plan.rules.inc
Action callback for the "Add to ad hoc deploy plan" action.
deploy_node_operation_add_to_managed_plan in ./deploy.core.inc
Node operation callback.
deploy_rules_action_add_to_managed_plan in ./deploy.rules.inc
Action callback for the "Add to deploy plan" action.
_deploy_auto_plan_entity_save in modules/deploy_auto_plan/deploy_auto_plan.module
Handles an entity being saved.

... See full list

File

./deploy.manager.inc, line 92
Deploy module functions for handling managed entities in plans.

Code

function deploy_manager_add_to_plan($plan_name, $entity_type, $entity) {
  list($entity_id, $revision_id) = entity_extract_ids($entity_type, $entity);
  $revision_id = $revision_id === NULL ? 0 : $revision_id;
  try {
    db_insert('deploy_manager_entities')
      ->fields(array(
      'plan_name' => $plan_name,
      'entity_type' => $entity_type,
      'entity_id' => $entity_id,
      'revision_id' => $revision_id,
      'timestamp' => microtime(TRUE),
    ))
      ->execute();
  } catch (Exception $e) {
    watchdog('deploy', 'Adding !entity_type !entity_id of revision !revision_id to deployment plan @plan failed. Only one entity per revision is allowed.', array(
      '!entity_type' => $entity_type,
      '!entity_id' => $entity_id,
      '!revision_id' => $revision_id,
      '@plan' => $plan_name,
    ), WATCHDOG_NOTICE);
  }
}