Archived
1
0
Fork 0

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

This commit is contained in:
Henrik Hautakoski 2018-08-14 23:17:34 +02:00
parent 2529d29d80
commit ec5c6f2d14
No known key found for this signature in database
GPG key ID: 839F3A7EAFAEAFAA

View file

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