Skip to content

Commit

Permalink
Added method to return all users
Browse files Browse the repository at this point in the history
  • Loading branch information
riculum committed Apr 16, 2022
1 parent a8abdd0 commit 564e189
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion core/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,26 @@ static function deleteUser(string $uuid)
}

/**
* @param int $uuid
* @param string $uuid
* @return array|null
*/
static function getUser(string $uuid): ?array
{
return DB::single('SELECT * FROM ' . $_ENV['DB_PREFIX'] . 'user WHERE uuid = ?', [$uuid]);
}

/**
* @return array|null
*/
static function getUsers(): ?array
{
return DB::single('SELECT * FROM ' . $_ENV['DB_PREFIX'] . 'user', []);
}

/**
* @param string $email
* @return array|null
*/
static function getUserByEmail(string $email): ?array
{
return DB::single('SELECT * FROM ' . $_ENV['DB_PREFIX'] . 'user WHERE email = ?', [$email]);
Expand Down

0 comments on commit 564e189

Please sign in to comment.