Exemplo n.º 1
0
 /**
  * @param SessionAccess $event
  */
 public function onSessionAccessEvent(SessionAccess $event)
 {
     $user = $event->getUser();
     $course = $event->getCourse();
     $session = $event->getSession();
     $trackAccess = new TrackEAccess();
     $trackAccess->setCId($course->getId());
     $trackAccess->setAccessUserId($user->getId());
     $trackAccess->setAccessSessionId($session->getId());
     $this->em->persist($trackAccess);
     $this->em->flush();
 }
Exemplo n.º 2
0
 /**
  * @param CourseAccess $event
  */
 public function onCourseAccessEvent(CourseAccess $event)
 {
     $user = $event->getUser();
     $course = $event->getCourse();
     if ($user && $course) {
         $trackAccess = new TrackEAccess();
         $trackAccess->setCId($course->getId());
         $trackAccess->setAccessUserId($user->getId());
         $trackAccess->setAccessSessionId(0);
         $this->em->persist($trackAccess);
         $this->em->flush();
     }
 }