Tour-Ansprechpartner änderbar, Selbst-Austragung gesperrt

This commit is contained in:
torsten 2026-11-08 17:13:11 +01:00
parent 77df14237c
commit 322d232012
5 changed files with 82 additions and 5 deletions

View file

@ -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';