1
0
Fork 0
mirror of https://codeberg.org/demostf/api.git synced 2026-06-04 02:14:06 +02:00

allow querying users by id

This commit is contained in:
Robin Appelman 2020-07-18 16:21:25 +02:00
commit f4f1454d59
2 changed files with 5 additions and 0 deletions

View file

@ -71,6 +71,9 @@ class UserProvider extends BaseProvider {
}
public function getById(int $userId): ?User {
if ($userId > pow(2, 31)) {
return null;
}
// first search in the view which contains the most used name for the users
$query = $this->getQueryBuilder();