Cartalyst\Sentinel\Checkpoints\NotActivatedException::setUser PHP Method

setUser() public method

Sets the user associated with Sentinel (does not log in).
public setUser ( Cartalyst\Sentinel\Users\UserInterface $user ) : void
$user Cartalyst\Sentinel\Users\UserInterface
return void
    public function setUser(UserInterface $user)
    {
        $this->user = $user;
    }

Usage Example

 /**
  * Checks the activation status of the given user.
  *
  * @param  \Cartalyst\Sentinel\Users\UserInterface  $user
  * @return bool
  * @throws \Cartalyst\Sentinel\Checkpoints\NotActivatedException
  */
 protected function checkActivation(UserInterface $user)
 {
     $completed = $this->activations->completed($user);
     if (!$completed) {
         $exception = new NotActivatedException('Your account has not been activated yet.');
         $exception->setUser($user);
         throw $exception;
     }
 }
NotActivatedException