Пример #1
0
 /**
  * Update a service status based on incident status
  * @param IncidentEvent $event
  * @return
  */
 public function updateService(IncidentEvent $event)
 {
     $incident = $event->getIncident();
     $service = $incident->getService();
     $service = $this->serviceStatusUpdater->update($service, $incident);
     $this->em->persist($service);
     $this->em->flush();
 }
Пример #2
0
 /**
  * create Send a email to all subscriber
  * @param IncidentEvent $event
  * @return
  */
 public function create(IncidentEvent $event)
 {
     $subscriberRepository = $this->em->getRepository('AppBundle:Core\\Subscriber');
     $subscribers = $subscriberRepository->findAllSubscribers()->getQuery()->getResult();
     $incident = $event->getIncident();
     if (count($subscribers) > 0) {
         foreach ($subscribers as $subscriber) {
             $this->mailer->sendIncidentMailToSubscriber($incident, $subscriber);
         }
     }
 }
 /**
  * create Send a notification to all notifier available
  * @param IncidentEvent $event
  * @return
  */
 public function create(IncidentEvent $event)
 {
     $incident = $event->getIncident();
     $this->notification->sendIncidentNotification($incident);
 }