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
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;
 }
Example #2
0
 /**
  * Sets the user associated with Sentinel (does not log in).
  *
  * @param User $user
  *
  * @return void
  */
 public function setUser(User $user)
 {
     $this->sentinel->setUser($user);
 }
Example #3
0
 /**
  * Sets the user associated with Sentinel (does not log in).
  *
  * @param \Cartalyst\Sentinel\Users\UserInterface $user
  * @return void 
  * @static 
  */
 public static function setUser($user)
 {
     \Cartalyst\Sentinel\Sentinel::setUser($user);
 }