public function processAcceptInterest(InterestEvent $event)
 {
     // Le propriétaire
     $userLog = new UserLog();
     $userLog->setUser($event->getOwner())->setType($this->getNotificationType())->setOwner($event->getCustomer())->setUserAsked($event->getOwner())->setAdvert($event->getAdvert())->setContent('');
     // Le propriétaire
     $userLogCustomer = new UserLog();
     $userLogCustomer->setUser($event->getCustomer())->setType($this->getNotificationType())->setOwner($event->getCustomer())->setUserAsked($event->getOwner())->setAdvert($event->getAdvert())->setContent('');
     $this->recordLog($userLog, $userLogCustomer);
     $this->sendMessage($event);
     return;
 }
 public function processAddInterest(InterestEvent $event)
 {
     // Initialisation
     $userLogCustomer = new UserLog();
     $userLogCustomer->setOwner($event->getCustomer());
     // L'acheter potentiel ( interest ) est le propriétaire du log
     $userLogCustomer->setUser($event->getCustomer());
     $userLogCustomer->setUserAsked($event->getCustomer());
     $userLogCustomer->setAdvert($event->getAdvert());
     $userLogCustomer->setContent('');
     $userLogCustomer->setType($this->getNotificationType());
     $this->recordLog($userLogCustomer);
     // Si l'utilisateur n'est pas un membre
     if (is_null($event->getOwner())) {
         $this->sendGuestMessage($event);
     } else {
         $userLog = new UserLog();
         $userLog->setType($this->getNotificationType())->setUser($event->getOwner())->setOwner($event->getCustomer())->setUserAsked($event->getOwner())->setAdvert($event->getAdvert())->setContent('');
         $this->recordLog($userLog);
         if ($event->getOwnerNotifications()) {
             $this->sendMessage($event);
         }
     }
     return;
 }
 public function processRemoveInterest(InterestEvent $event)
 {
     // L'acheteur
     $userLogCustomer = new UserLog();
     $userLogCustomer->setUser($event->getCustomer())->setOwner($event->getCustomer())->setUserAsked($event->getOwner())->setAdvert($event->getAdvert())->setType($this->getNotificationType())->setContent('');
     $this->recordLog($userLogCustomer);
     // Si l'utilisateur n'est pas un membre
     if (is_null($event->getOwner())) {
         $this->sendGuestMessage($event);
     } else {
         // Le propriétaire
         $userLog = new UserLog();
         $userLog->setUser($event->getOwner())->setOwner($event->getCustomer())->setUserAsked($event->getCustomer())->setType($this->getNotificationType())->setAdvert($event->getAdvert())->setContent('');
         $this->recordLog($userLog);
     }
     return;
 }