You are here

function notifications_notifications_event in Notifications 6.4

Implementation of hook notifications_event()

Invoke hook notifications with old parameters

File

./notifications.module, line 1781
Notifications module

Code

function notifications_notifications_event($op, $event, $account = NULL) {
  switch ($op) {
    case 'query':
      $query = array();

      // First get all the condition fields for the event object type
      // I.e. for a node event, we get all condition fields for the event's node
      if ($object = $event
        ->get_object($event->type)) {
        if ($fields = notifications_object_condition_fields($event->type, $object)) {

          // We get a merged array with field => array(value1, value2...);
          $query[]['fields'] = $fields;
        }
      }
      return $query;
    case 'load':

      // Invoke old hook for backwards compatibility
      return module_invoke_all('notifications', 'event load', $event);
  }
}