You are here

function notifications_messaging_method in Notifications 7

Implements hook_messaging_method()

File

./notifications.module, line 1021
Notifications module

Code

function notifications_messaging_method($op, $method, $param = NULL) {
  switch ($op) {
    case 'replace':

      // Replace old method $method by new method $param
      db_update('notifications_subscription')
        ->fields(array(
        'send_method' => $param,
      ))
        ->condition('send_method', $method)
        ->execute();
      break;
    case 'disable':

      // Disable all subscriptions for disabled method
      db_update('notifications_subscription')
        ->fields(array(
        'status' => Notifications_Subscription::STATUS_NOSEND,
      ))
        ->condition('send_method', $method)
        ->execute();
      break;
  }
}