Tour-Ansprechpartner änderbar, Selbst-Austragung gesperrt
This commit is contained in:
parent
77df14237c
commit
322d232012
5 changed files with 82 additions and 5 deletions
|
|
@ -17,6 +17,17 @@ class User extends Model
|
|||
return $row === null ? null : static::fromRow($row);
|
||||
}
|
||||
|
||||
/** Admins und Mitglieder, die als Tour-Ansprechpartner wählbar sind. */
|
||||
public static function selectableGuides(): array
|
||||
{
|
||||
$rows = db()->fetchAll(
|
||||
'SELECT * FROM `users` WHERE role IN (?, ?) ORDER BY name',
|
||||
['ADMIN', 'MEMBER']
|
||||
);
|
||||
|
||||
return array_map(fn(array $row) => static::fromRow($row), $rows);
|
||||
}
|
||||
|
||||
public function isAdmin(): bool
|
||||
{
|
||||
return $this->role === 'ADMIN';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue