You are here

function notifications_delete_subscription in Notifications 5

Same name and namespace in other branches
  1. 6.4 notifications.module \notifications_delete_subscription()
  2. 6 notifications.module \notifications_delete_subscription()
  3. 6.2 notifications.module \notifications_delete_subscription()
  4. 6.3 notifications.module \notifications_delete_subscription()

Delete subscription and clean up related data.

It also removes pending notifications related to that subscription

Parameters

$sid: Id of subscriptin to delete

5 calls to notifications_delete_subscription()
notifications_content_form_submit in notifications_content/notifications_content.module
Process generic form submission
notifications_form_unsubscribe_confirm_submit in ./notifications.admin.inc
Process form submission
notifications_save_subscription in ./notifications.module
Update or create subscription
notifications_ui_node_form_submit in notifications_ui/notifications_ui.module
Form submission, node subscriptions form
notifications_user_form_submit in ./notifications.admin.inc
Process generic form submission

File

./notifications.module, line 536
Notifications module

Code

function notifications_delete_subscription($sid) {
  foreach (array(
    'notifications',
    'notifications_fields',
    'notifications_queue',
  ) as $table) {
    db_query("DELETE FROM {" . $table . "} WHERE sid = %d", $sid);
  }
}