You are here

function nofitications_digest_event_info in Notifications 6

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

Get digest information for an event.

2 calls to nofitications_digest_event_info()
NotificationsTemplatesTests::testNotificationsTemplates in tests/notifications_templates.test
Play with creating, retrieving, deleting a pair subscriptions
notifications_process_digest_short in ./notifications.cron.inc
Digest multiple events in a single message, short format.

File

./notifications.cron.inc, line 603

Code

function nofitications_digest_event_info($event) {
  $info = notifications_event_types($event->type, $event->action);
  $type = $info['digest'][0];
  $field = $info['digest'][1];

  // Check object and values
  $object = !empty($event->objects[$type]) ? $event->objects[$type] : NULL;
  $value = $object && isset($object->{$field}) ? $object->{$field} : 0;
  return array(
    'type' => $type,
    'field' => $field,
    'value' => $value,
    'object' => $object,
  );
}