Esempio n. 1
0
 /**
  * Finds user by [[username]]
  *
  * @return User|null
  */
 public function getUser()
 {
     if ($this->_user === false) {
         $this->_user = User::findByUsername($this->username);
     }
     return $this->_user;
 }
Esempio n. 2
0
 public function login()
 {
     if (($user = User::findByUsername($this->username)) !== null) {
         return Yii::$app->user->login($user, 0);
     }
 }