Add functions for listing event actor names, time names, place names

This commit is contained in:
Joshua Ramon Enslin 2023-10-29 01:27:32 +02:00
parent 1dedb86d5b
commit 1108398437
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE
2 changed files with 43 additions and 1 deletions

2
l18n

@ -1 +1 @@
Subproject commit eea900820d19567f28d87bae7afda04e8cfde7b8
Subproject commit 8a2501a62c581a86dd4e08191376974ae3a6d3bc

View File

@ -95,4 +95,46 @@ final class MDEventsSet extends MDValueSet {
return parent::getTlSortedList($tlLoader, self::EVENT_IDS, "eventtype_name", "eventname");
}
/**
* Gets a list of the entries in a translated version (actor focus).
*
* @param MDTlLoader $tlLoader Translation loader.
*
* @return array<string>
*/
public static function getSortedListActors(MDTlLoader $tlLoader):array {
$output = parent::getTlSortedList($tlLoader, self::EVENT_IDS, "eventtype_persinst", "event_persinst");
foreach (self::EVENTS_NO_ACTOR as $id) unset($output[$id]);
return $output;
}
/**
* Gets a list of the entries in a translated version (place focus).
*
* @param MDTlLoader $tlLoader Translation loader.
*
* @return array<string>
*/
public static function getSortedListPlaces(MDTlLoader $tlLoader):array {
$output = parent::getTlSortedList($tlLoader, self::EVENT_IDS, "eventtype_place", "event_place");
foreach (self::EVENTS_NO_PLACE as $id) unset($output[$id]);
return $output;
}
/**
* Gets a list of the entries in a translated version.
*
* @param MDTlLoader $tlLoader Translation loader.
*
* @return array<string>
*/
public static function getSortedListTimes(MDTlLoader $tlLoader):array {
$output = parent::getTlSortedList($tlLoader, self::EVENT_IDS, "eventtype_time", "event_time");
foreach (self::EVENTS_NO_TIME as $id) unset($output[$id]);
return $output;
}
}