findByUsername() public static method

Finds user by username
public static findByUsername ( string $username ) : static | null
$username string
return static | null
Ejemplo n.º 1
0
 /**
  * Finds user by [[username]]
  *
  * @return User|null
  */
 public function getUser()
 {
     if ($this->_user === false) {
         $this->_user = Member::findByUsername($this->username);
     }
     return $this->_user;
 }
Ejemplo n.º 2
0
 /**
  * Finds member by [[username]]
  *
  * @return Member|null
  */
 public function getMember()
 {
     if ($this->_member === null) {
         $this->_member = Member::findByUsername($this->username);
     }
     return $this->_member;
 }