コード例 #1
0
ファイル: Profile.php プロジェクト: jaapjansma/homefinance
 public function updateUser(User $user)
 {
     $user->setEmail($this->email);
     $user->setName($this->name);
     return $user;
 }
コード例 #2
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;
 }