コード例 #1
0
 /**
  * Handle the command.
  *
  * @param UserRepositoryInterface $users
  * @return bool
  */
 public function handle(UserRepositoryInterface $users)
 {
     $user = $users->findByResetCode($this->code);
     if (!$user) {
         return false;
     }
     if ($user->getId() !== $this->user->getId()) {
         return false;
     }
     $this->user->setAttribute('reset_code', null);
     $this->user->setAttribute('password', $this->password);
     $users->save($this->user);
     return true;
 }
コード例 #2
0
 /**
  * Handle the command.
  *
  * @param UserRepositoryInterface $users
  * @return bool
  */
 public function handle(UserRepositoryInterface $users)
 {
     $users->save($this->user->setAttribute('activation_code', str_random(40)));
     return true;
 }
コード例 #3
0
 /**
  * Handle the command.
  *
  * @param UserRepositoryInterface $users
  * @return bool
  */
 public function handle(UserRepositoryInterface $users)
 {
     return $users->save($this->user->setAttribute('reset_code', str_random(40)));
 }