public function Notifications_Scheduler_Event::done in Notifications 7
When done these events cannot be just deleted, we need to keep track of last time it was executed
File
- notifications_scheduler/
notifications_scheduler.inc, line 163 - Drupal Notifications Framework - Default class file
Class
- Notifications_Scheduler_Event
- Notifications Schedule Event class
Code
public function done() {
$this
->record(TRUE);
// Now take care of previous events of this type / action
if (variable_get('notifications_event_log', NOTIFICATIONS_EVENT_LOG)) {
// If logging enabled, make logs of previous events
$query = db_update('notifications_event')
->fields(array(
'log' => 1,
));
}
else {
// If not logging enabled, delete all previous events
$query = db_delete('notifications_event');
}
$query
->condition('type', $this->type)
->condition('action', $this->action)
->condition('eid', $this->eid, '<')
->execute();
}