You are here

function Notifications_Queue::queue_delete in Notifications 6.4

Delete rows from subscriptions queue

Note: Handle with care if wrong params it may delete all rows

Parameters

$params: Array of conditions. If none, all rows for disabled subscriptions will be deleted

2 calls to Notifications_Queue::queue_delete()
Notifications_Queue::queue_clean in includes/notifications_queue.class.inc
Clean queue for a user and update event tracker
Notifications_Queue::queue_done in includes/notifications_queue.class.inc
Mark queue rows as done

File

includes/notifications_queue.class.inc, line 701

Class

Notifications_Queue
Queue management and processing

Code

function queue_delete($params) {
  if ($params) {
    $query = $this
      ->queue_query($params);
    db_query("DELETE FROM {notifications_queue} WHERE " . implode(' AND ', $query['where']), $query['args']);
  }
  else {

    // Delete all queued notifications for subscriptions not active
    // Note queue rows without subscription will be kept (like the ones form notifications_lite)
    db_query("DELETE FROM {notifications_queue} WHERE sid IN (SELECT sid FROM {notifications} WHERE status <> %d)", NOTITICATIONS_SUBSCRIPTION_ACTIVE);
  }
  return db_affected_rows();
}