You are here

function _datereminder_clean_node_reminders in Date Reminder 7

Same name and namespace in other branches
  1. 6.2 includes/db6.inc \_datereminder_clean_node_reminders()
  2. 6 datereminder.module \_datereminder_clean_node_reminders()

Clean up any references to a given node or nodes.

Parameters

array $nids: nid (or array of nids) to clean up.

int $en: If not NULL, also remove this nid from {datereminder_enable}. Defaults to NULL.

Note, we'll clean reminders even if this type didn't acutally have reminders enabled. It's always possible that something messed up and left some reminders lying around.

3 calls to _datereminder_clean_node_reminders()
datereminder_rules_action_delete_all_node_reminders in ./datereminder.rules.inc
Delete all reminders for a node.
_datereminder_clean_type_reminders in includes/db7.inc
Clean out reminders for everything associated with this type.
_datereminder_set_nid_enabled in includes/db7.inc
Version of _datereminder_set_node_enabled() that takes nid instead of node structure.

File

includes/db7.inc, line 28

Code

function _datereminder_clean_node_reminders($nids, $en = NULL) {
  if (!is_array($nids)) {
    $nids = array(
      $nids,
    );
  }
  db_delete('datereminder')
    ->condition('nid', $nids, 'IN')
    ->execute();
  if (isset($en)) {
    db_delete('datereminder_enable')
      ->condition('nid', $nids, 'IN')
      ->execute();
  }
}