/**
  * @param \ArtesanIO\ArtesanusBundle\Event\CoursesEvent $event
  */
 public function onCoursePreUpdate(CoursesEvent $event)
 {
     $course = $event->getCourse();
     $user = $this->security->getToken()->getUser();
     $course->setUpdater($user);
     $course->setUpdated(new \Datetime('now'));
 }
 /**
  * @param \AppBundle\Event\ConfigureMenuEvent $event
  */
 public function onCoursePreCreate(CoursesEvent $event)
 {
     $course = $event->getCourse();
     $user = $this->security->getToken()->getUser();
     $sluger = substr(md5(uniqid() . $this->slug->slugify($course->getCourse())), 0, 8);
     $course->setSlug($sluger);
     $course->setCreator($user);
 }