예제 #1
0
 /**
  * Handle the command.
  *
  * @param UserRepositoryInterface $users
  * @return bool
  */
 public function handle(UserRepositoryInterface $users)
 {
     if (!($user = $users->findByActivationCode($this->code))) {
         return false;
     }
     if ($this->user->getId() !== $user->getId()) {
         return false;
     }
     $this->user->activated = true;
     $this->user->activation_code = null;
     $users->save($this->user);
     return true;
 }