Example #1
0
 /**
  * Record an EchoNotification for an EchoEvent
  * Currently used for web-based notifications.
  *
  * @param $user User to notify.
  * @param $event EchoEvent to notify about.
  */
 public static function notifyWithNotification($user, $event)
 {
     global $wgEchoConfig, $wgEchoNotifications;
     // Only create the notification if the user wants to recieve that type
     // of notification and they are eligible to recieve it. See bug 47664.
     $userWebNotifications = EchoNotificationController::getUserEnabledEvents($user, 'web');
     if (!in_array($event->getType(), $userWebNotifications)) {
         return;
     }
     EchoNotification::create(array('user' => $user, 'event' => $event));
     MWEchoEventLogging::logSchemaEcho($user, $event, 'web');
 }