Authentication: replace getUserId with Member::fromEmailAddress
This commit is contained in:
1 parent
3de4e9391c
commit
9c86d2c475
4 files changed
+21
-26
No files matched your search
+10
-1
@@ -8,7 +8,7 @@
|
||||
|
||||
class Member extends User
|
||||
{
|
||||
private function __construct($data)
|
||||
private function __construct($data = [])
|
||||
{
|
||||
foreach ($data as $key => $value)
|
||||
$this->$key = $value;
|
||||
@@ -18,6 +18,15 @@ class Member extends User
|
||||
$this->is_admin = $this->is_admin == 1;
|
||||
}
|
||||
|
||||
public static function fromEmailAddress($email_address)
|
||||
{
|
||||
return Registry::get('db')->queryObject(static::class, '
|
||||
SELECT *
|
||||
FROM users
|
||||
WHERE emailaddress = {string:email_address}',
|
||||
['email_address' => $email_address]);
|
||||
}
|
||||
|
||||
public static function fromId($id_user)
|
||||
{
|
||||
$row = Registry::get('db')->queryAssoc('
|
||||
|
||||
Reference in new issue
Block a user