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(); }
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(); }
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(); }
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(); }
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(); }
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(); }