Esempio n. 1
0
 public function updateUser(User $user)
 {
     $user->setEmail($this->email);
     $user->setName($this->name);
     return $user;
 }
Esempio n. 2
0
 public function resetPasswordMail(User $user)
 {
     $template = 'HomefinanceBundle:mailer:reset_password.txt.twig';
     $context = array('user' => $user);
     $this->sendMessage($template, $context, $user->getEmail());
 }
Esempio n. 3
0
 public function createOrFindUserByEmail($email)
 {
     $user = false;
     try {
         $user = $this->findUserByEmail($email);
     } catch (EntityNotFoundException $e) {
         //user not found create one
     }
     if (!$user) {
         $user = new User();
         $user->setEmail($email);
         $user->setEnabled(false);
         $event = new UserEvent($user);
         $this->dispatcher->dispatch(UserEvents::EMAIL_REGISTRATION_SUCCESS, $event);
         $this->entityManager->persist($user);
         $this->entityManager->flush();
     }
     return $user;
 }