public function updateUser(User $user) { $user->setEmail($this->email); $user->setName($this->name); return $user; }
public function resetPasswordMail(User $user) { $template = 'HomefinanceBundle:mailer:reset_password.txt.twig'; $context = array('user' => $user); $this->sendMessage($template, $context, $user->getEmail()); }
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; }