Пример #1
0
 public function removeNegoce(AdvertNegoce $advertNegoce)
 {
     $this->containerInterface->get('event_dispatcher')->dispatch(SkuagEvents::ON_REFUSE_NEGOCE, new NegoceEvent($advertNegoce->getAdvert(), $advertNegoce->getUser(), $this->getPrice()));
     $this->entityManager->remove($advertNegoce);
     $this->entityManager->flush();
     return;
 }
 public function advertNegoceNotification(AdvertNegoce $entity)
 {
     $message = new \Swift_Message("Une proposition vient d'arriver", $this->getTemplating()->render('SnoozitPlatformBundle:Mail/DoctrineListener/Persist:NegoceMail.html.twig', array('slug' => $entity->getAdvert()->getSlug(), 'id' => $entity->getAdvert()->getId(), 'title' => $entity->getAdvert()->getTitle(), 'userInterested' => $this->getUsername(), 'ownername' => $entity->getUser()->getUsername())), 'text/html');
     $message->addTo('*****@*****.**')->addFrom('*****@*****.**');
     $this->mailer->send($message);
 }