You are here

function notifications_load_event in Notifications 6

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

Get events with static caching

2 calls to notifications_load_event()
notifications_process_queue in ./notifications.cron.inc
Process subscriptions queue
notifications_process_rows in ./notifications.cron.inc
Process rows given query conditions

File

./notifications.cron.inc, line 515

Code

function notifications_load_event($id) {
  static $cache = array();
  if (!array_key_exists($id, $cache)) {
    $event = db_fetch_object(db_query("SELECT * FROM {notifications_event} WHERE eid = %d", $id));
    $event->params = unserialize($event->params);

    // Load aditional objects for the event
    $event->objects = array();
    notifications_module_invoke('event load', $event);
    $cache[$id] = $event;
  }
  return $cache[$id];
}