You are here

function notifications_update_sent in Notifications 6.3

Same name and namespace in other branches
  1. 5 notifications.cron.inc \notifications_update_sent()
  2. 6 notifications.cron.inc \notifications_update_sent()
  3. 6.2 notifications.cron.inc \notifications_update_sent()

Update user last time sent for each sending method / interval

1 call to notifications_update_sent()
notifications_process_rows in ./notifications.cron.inc
Process rows given query conditions

File

./notifications.cron.inc, line 448

Code

function notifications_update_sent($account, $method, $interval, $time) {
  db_query("UPDATE {notifications_sent} SET sent = %d WHERE uid = %d AND send_interval = '%d' AND send_method = '%s'", $time, $account->uid, $interval, $method);
  if (!db_affected_rows()) {
    db_query("INSERT INTO {notifications_sent}(uid, send_interval, send_method, sent) VALUES(%d, '%d', '%s', %d)", $account->uid, $interval, $method, $time);
  }
}