Cartalyst\Sentinel\Sentinel::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

Example #1
0
 /**
  * Authenticate a user via the id.
  *
  * @param  mixed $id
  *
  * @return bool
  */
 public function byId($id)
 {
     if ($user = $this->sentinel->getUserRepository()->findById($id)) {
         $this->sentinel->setUser($user);
         return true;
     }
     return false;
 }
All Usage Examples Of Cartalyst\Sentinel\Sentinel::setUser