Skip to content

Commit

Permalink
[add] find by username
Browse files Browse the repository at this point in the history
  • Loading branch information
elfarqy authored and haqqi committed Jan 26, 2017
1 parent 6a29148 commit 73d6a50
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions common/models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,16 @@ public static function findIdentityByAccessToken($token, $type = null)
throw new NotSupportedException('"findIdentityByAccessToken" is not implemented.');
}

public static function findByUsername($username)
{
return static::findOne(['username' => $username]);
}

public static function findByEmail($email)
{
return static::findOne(['email' => $email]);
}

public function getId()
{
return $this->getPrimaryKey();
Expand Down

0 comments on commit 73d6a50

Please sign in to comment.