Archived
1
0
Fork 0

app/models/Data/User.php: adding findFirstByUsername()

This commit is contained in:
Henrik Hautakoski 2018-08-15 21:41:05 +02:00
parent aced9f8bf3
commit 6876cc13be
No known key found for this signature in database
GPG key ID: 839F3A7EAFAEAFAA

View file

@ -366,6 +366,14 @@ class User extends Model
]);
}
static public function findFirstByUsername($username)
{
return self::findFirst([
"username = :username: AND status != :s:",
"bind" => [ 'username' => $username, 's' => self::STATUS_DELETED ]
]);
}
static public function findFirstByOAuthID(UserDataInterface $oauth)
{
$column = strtolower($oauth->getProvider());