* @package oat\tao\model\extension */ class AlarmNotificationService extends AbstractNotificationService { public const SERVICE_ID = 'tao/AlarmNotificationService'; /** * @param TaoUpdateEvent $event */ public function listenTaoUpdateEvent(TaoUpdateEvent $event) { $reportMessages = $event->getReport()->filterChildrenByTypes([Report::TYPE_ERROR]); if (count($reportMessages) === 0) return; $message = ''; /**@var $dispatchReport Report */ foreach ($reportMessages as $dispatchReport) { $message .= $dispatchReport->getMessage() . PHP_EOL; } $alert = new Alert('Tao Update notifications: ' . ROOT_URL, $message); $this->sendNotifications($alert); } }