You are here

function rules_scheduler_action_delete in Rules 6

Same name and namespace in other branches
  1. 7.2 rules_scheduler/rules_scheduler.rules.inc \rules_scheduler_action_delete()

Action implementation for deleting already scheduled tasks.

1 call to rules_scheduler_action_delete()
rules_scheduler_delete_submit in rules_scheduler/rules_scheduler.admin.inc
Submit handler for deletion/cancellation of future scheduled tasks.
1 string reference to 'rules_scheduler_action_delete'
rules_scheduler_rules_action_info in rules_scheduler/rules_scheduler.rules.inc
Implementation of hook_rules_action_info().

File

rules_scheduler/rules_scheduler.rules.inc, line 87
Rules integration for the rules scheduler module.

Code

function rules_scheduler_action_delete($task_identifier = NULL, $rule_set_name = NULL) {
  if (!empty($rule_set_name)) {
    if (!empty($task_identifier)) {
      db_query("DELETE FROM {rules_scheduler} WHERE set_name = '%s' AND identifier = '%s'", $rule_set_name, $task_identifier);
    }
    else {
      db_query("DELETE FROM {rules_scheduler} WHERE set_name = '%s'", $rule_set_name);
    }
  }
  else {
    if (!empty($task_identifier)) {
      db_query("DELETE FROM {rules_scheduler} WHERE identifier = '%s'", $task_identifier);
    }
  }
}