You are here

function deploy_plan_item_delete in Deploy - Content Staging 6

Delete item from plan.

Parameters

$conditions: An array of fields and values used to build a sql WHERE clause indicating what items should be deleted.

4 calls to deploy_plan_item_delete()
content_copy_node_type in modules/content_copy_deploy/content_copy_deploy.module
Implementation of hook_node_type().
deploy_list_multiple_delete_confirm_submit in ./deploy.plans.admin.inc
Form submit callback for deploy_list_multiple_delete_confirm().
node_deploy_nodeapi in modules/node_deploy/node_deploy.module
Implementation of hook_nodeapi().
views_deploy_delete_form_submit in modules/views_deploy/views_deploy.module
Submit handler for the Views delete form.

File

./deploy.module, line 1196
Deployment API which enables modules to deploy items between servers.

Code

function deploy_plan_item_delete($conditions = array()) {
  $schema = drupal_get_schema('deploy_plan_items');
  $where = array();

  // Build an array of fields with the appropriate placeholders for use in
  // db_query().
  foreach ($conditions as $field => $value) {
    $where[] = $field . ' = ' . db_type_placeholder($schema['fields'][$field]['type']);
  }

  // Now implode that array into an actual WHERE clause.
  $where = implode(' AND ', $where);
  db_query('DELETE FROM {deploy_plan_items} WHERE ' . $where, $conditions);
}