コード例 #1
0
 /**
  * @param Command|ChangeEmail $command
  */
 public function handle(Command $command)
 {
     /** @var User $user */
     $user = $this->userRepository->get($command->getUser());
     //No-op if email is same as existing
     if ($user->getEmail() == $command->getEmail()) {
         return;
     }
     $user->changeEmail($command->getEmail());
 }
コード例 #2
0
 /**
  * @param Command|ChangePassword $command
  */
 public function handle(Command $command)
 {
     /** @var User $user */
     $user = $this->userRepository->get($command->getUser());
     $user->changePassword($command->getPassword(), $this->encoder);
 }