/** * Trigger a notification event * * @param String $identifier * The Identifier of the notification event * @param DataObject $context * The context (if relevant) of the object to notify on * @param array $data * Extra data to be sent along with the notification */ public function notify($identifier, $context, $data = array(), $channel = null) { // okay, lets find any notification set up with this identifier if ($notifications = SystemNotification::get()->filter('Identifier', $identifier)) { foreach ($notifications as $notification) { if ($notification->NotifyOnClass && $notification->NotifyOnClass != get_class($context)) { continue; } else { $this->sendNotification($notification, $context, $data, $channel); } } } }
public function getNotification() { return SystemNotification::get()->byID($this->notificationID); }