Add Authors index

This commit is contained in:
Alex Cabal 2025-04-09 21:33:59 -05:00
parent 0e92b3acc8
commit 93b55d2da2
7 changed files with 37 additions and 11 deletions

View file

@ -44,23 +44,27 @@ class Contributor{
/**
* @return array<Contributor>
*/
public static function GetAllAuthorNames(): array{
public static function GetAllByMarcRole(Enums\MarcRole $marcRole): array{
return Db::Query('
SELECT DISTINCT Name
SELECT
*
from Contributors
where MarcRole = "aut"
order by Name asc', [], Contributor::class);
where MarcRole = ?
and SortName is not null
group by SortName
order by SortName asc', [$marcRole], Contributor::class);
}
/**
* @return array<Contributor>
* @return array<stdClass>
*/
public static function GetAllTranslatorNames(): array{
public static function GetAllNamesByMarcRole(Enums\MarcRole $marcRole): array{
return Db::Query('
SELECT DISTINCT Name
SELECT
distinct Name
from Contributors
where MarcRole = "trl"
order by Name asc', [], Contributor::class);
where MarcRole = ?
order by Name asc', [$marcRole]);
}
/**