recordLogin() public method

Records a login for the given user.
public recordLogin ( Cartalyst\Sentinel\Users\UserInterface $user ) : Cartalyst\Sentinel\Users\UserInterface | boolean
$user Cartalyst\Sentinel\Users\UserInterface
return Cartalyst\Sentinel\Users\UserInterface | boolean
コード例 #1
0
ファイル: Sentinel.php プロジェクト: raikeiji/sentinel
 /**
  * Persists a login for the given user.
  *
  * @param  \Cartalyst\Sentinel\Users\UserInterface  $user
  * @param  bool  $remember
  * @return \Cartalyst\Sentinel\Users\UserInterface|bool
  */
 public function login(UserInterface $user, $remember = false)
 {
     $method = $remember === true ? 'persistAndRemember' : 'persist';
     $this->persistences->{$method}($user);
     $response = $this->users->recordLogin($user);
     if ($response === false) {
         return false;
     }
     return $this->user = $user;
 }