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