Ejemplo n.º 1
0
 public function onPush(PushEvent $event)
 {
     $params = ['from' => $event->getBasket()->getPusher()->getId(), 'to' => $event->getBasket()->getUser()->getId(), 'message' => $event->getMessage(), 'ssel_id' => $event->getBasket()->getId()];
     $datas = json_encode($params);
     $mailed = false;
     if ($this->shouldSendNotificationFor($event->getBasket()->getUser(), 'eventsmanager_notify_push')) {
         $basket = $event->getBasket();
         $user_from = $event->getBasket()->getPusher();
         $user_to = $event->getBasket()->getUser();
         $receiver = Receiver::fromUser($user_to);
         $emitter = Emitter::fromUser($user_from);
         $mail = MailInfoPushReceived::create($this->app, $receiver, $emitter, $params['message'], $event->getUrl());
         $mail->setBasket($basket);
         $mail->setPusher($user_from);
         $this->app['notification.deliverer']->deliver($mail, $event->hasReceipt());
         $mailed = true;
     }
     return $this->app['events-manager']->notify($params['to'], 'eventsmanager_notify_push', $datas, $mailed);
 }
Ejemplo n.º 2
0
 public function __construct(ValidationParticipant $participant, Basket $basket, $url, $message = null, $receipt = false, $duration = 0)
 {
     parent::__construct($basket, $message, $url, $receipt);
     $this->participant = $participant;
     $this->duration = $duration;
 }