You are here

public static function Notifications_Subscription::delete_multiple in Notifications 7

Delete multiple subscriptions and clean up related data (pending notifications, fields).

Was notifications_delete_subscriptions ($params, $field_conditions = array(), $limit = FALSE)

Warning: If !$limit, it will delete also subscriptions with more conditions than the fields passed.

Parameters

array $params: Array of multiple conditions in the notifications table to delete subscriptions

array $field_conditions: Array of multiple conditions in the notifications_subscription_fields table to delete subscriptions

$limit: Whether to limit the result to subscriptions with exactly that condition fields

Return value

int Number of deleted subscriptions

8 calls to Notifications_Subscription::delete_multiple()
notifications_account_form_unsubscribe_confirm_submit in notifications_account/notifications_account.pages.inc
Process unsubscribe form submission
notifications_content_node_delete in notifications_content/notifications_content.module
Implementation of hook_node_delete()
notifications_content_node_type_delete in notifications_content/notifications_content.module
Implements hook_node_type_delete().
notifications_delete_destination in ./notifications.module
Shorthand function for deleting everything related to a destination
notifications_page_unsubscribe_user in ./notifications.pages.inc
Menu callback for unsubscribe page

... See full list

File

./notifications.subscription.inc, line 802
Drupal Notifications Framework - Default class file

Class

Notifications_Subscription
Common base for subscription type and subscription instance

Code

public static function delete_multiple($conditions, $field_conditions = array(), $limit = FALSE) {
  $query = self::select_subscriptions($conditions, $field_conditions, $limit);
  if ($sids = $query
    ->execute()
    ->fetchCol()) {
    return self::delete_subscription($sids);
  }
}