Ejemplo n.º 1
0
 public function onShopOrder(\Club\ShopBundle\Event\FilterOrderEvent $event)
 {
     $order = $event->getOrder();
     $user = $this->security_context->getToken()->getUser();
     $log = new \Club\LogBundle\Entity\Log();
     $log->setEvent('onShopOrder');
     $log->setSeverity('informational');
     $log->setUser($user);
     $log->setLogType('general');
     $log->setLog('Created a new order #' . $order->getId());
     $this->em->persist($log);
     $this->em->flush();
 }
 public function onEventUnattend(\Club\EventBundle\Event\FilterAttendEvent $event)
 {
     $e = $event->getAttend()->getEvent();
     $user = $event->getAttend()->getUser();
     $log = new \Club\LogBundle\Entity\Log();
     $log->setEvent('onEventUnattend');
     $log->setSeverity('informational');
     $log->setUser($user);
     $log->setLogType('event');
     $log->setLog('User unattend to event: ' . $e->getEventName());
     $this->em->persist($log);
     $this->em->flush();
 }
Ejemplo n.º 3
0
 public function onEventAdd(\Club\EventBundle\Event\FilterEventEvent $event)
 {
     $e = $event->getEvent();
     $user = $this->security_context->getToken()->getUser();
     $log = new \Club\LogBundle\Entity\Log();
     $log->setEvent('onEventAdd');
     $log->setSeverity('informational');
     $log->setUser($user);
     $log->setLogType('event');
     $log->setLog('Created a new event: ' . $e->getEventName());
     $this->em->persist($log);
     $this->em->flush();
 }
Ejemplo n.º 4
0
 public function onBookingCancel(\Club\BookingBundle\Event\FilterBookingEvent $event)
 {
     $booking = $event->getBooking();
     $log = new \Club\LogBundle\Entity\Log();
     $log->setEvent('onBookingConfirm');
     $log->setSeverity('informational');
     $log->setLogType('booking');
     $log->setLog('Deleted a booking');
     if ($this->security_context->getToken() && $this->security_context->isGranted('IS_AUTHENTICATED_FULLY')) {
         $log->setUser($this->security_context->getToken()->getUser());
     }
     $this->em->persist($log);
     $this->em->flush();
 }
Ejemplo n.º 5
0
 public function onShopOrder(\Club\ShopBundle\Event\FilterOrderEvent $event)
 {
     $order = $event->getOrder();
     $log = new \Club\LogBundle\Entity\Log();
     $log->setEvent('onShopOrder');
     $log->setSeverity('informational');
     $log->setLogType('shop');
     $log->setLog('Created a new order #' . $order->getId());
     if ($this->security_context->getToken() && $this->security_context->isGranted('IS_AUTHENTICATED_FULLY')) {
         $log->setUser($this->security_context->getToken()->getUser());
     }
     $this->em->persist($log);
     $this->em->flush();
 }
Ejemplo n.º 6
0
 protected function setError($error)
 {
     $this->error = $error;
     $this->is_valid = false;
     $partners = '';
     foreach ($this->booking->getUsers() as $partner) {
         $partners .= $partner->getId() . ', ';
     }
     $log = new \Club\LogBundle\Entity\Log();
     $log->setEvent('onBookingError');
     $log->setSeverity('informational');
     $log->setLogType('booking');
     $log->setLog(sprintf('Booking error: %s, with partners: %s', $error, $partners));
     $log->setUser($this->security_context->getToken()->getUser());
     $this->em->persist($log);
     $this->em->flush();
 }