/** * Triggered on a successful login. Set the resetCode and resetExpires * to null, and persist to the database. * * @param \Symfony\Component\Security\Http\Event\InteractiveLoginEvent $event */ public function onInteractiveLogin(InteractiveLoginEvent $event) { $user = $event->getAuthenticationToken()->getUser(); if ($user) { $user->setResetCode(null); $user->setResetExpires(null); $this->doctrine->getManager()->persist($user); $this->doctrine->getManager()->flush(); } }
public function completeVoyageCreation($user) { if ($user) { if ($this->session->has('voyage')) { $voyage = $this->session->get('voyage'); $voyage->setUtilisateur($user); $this->doctrine->getManager()->persist($voyage); $this->doctrine->getManager()->flush(); $this->session->getFlashBag()->add('notice', 'Votre navette a été crée'); } } }