function notifications_load_event in Notifications 5
Same name and namespace in other branches
- 6 notifications.cron.inc \notifications_load_event()
- 6.2 notifications.cron.inc \notifications_load_event()
- 6.3 notifications.cron.inc \notifications_load_event()
Get events with static caching
3 calls to notifications_load_event()
- notifications_process_pull in ./
notifications.cron.inc - Support of pull messaging
- 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 634
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];
}