예제 #1
0
 /**
  *
  * @param User $user
  * @throws \Veloci\User\Exception\ValidationException
  */
 public function signup(User $user)
 {
     $this->modelValidator->validate($user);
     if ($this->userRepository->usernameAlreadyExists($user->getUsername())) {
         throw new ValidationException(['username' => 'duplicated']);
     }
     $this->userRepository->save($user);
 }