コード例 #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();
 }
コード例 #2
0
 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();
 }
コード例 #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();
 }
コード例 #4
0
 public function onTaskError(\Club\LogBundle\Event\FilterLogEvent $event)
 {
     $log = new \Club\LogBundle\Entity\Log();
     $log->setEvent($event->getEvent());
     $log->setSeverity($event->getSeverity());
     $log->setLogType($event->getType());
     $log->setLog($event->getMessage());
     $this->em->persist($log);
     $this->em->flush();
 }
コード例 #5
0
ファイル: Booking.php プロジェクト: miteshchavada/clubmaster
 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();
 }
コード例 #6
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();
 }
コード例 #7
0
ファイル: Booking.php プロジェクト: miteshchavada/clubmaster
 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();
 }