Compare commits

..

2 Commits

Author SHA1 Message Date
jrenslin 8a1c33fbc3 Update translation files 2026-05-31 18:01:44 +02:00
jrenslin c693fff212 Add MDAppointmentImageCategory
See museum-digital/musdb#1526
2026-05-31 18:00:58 +02:00
3 changed files with 95 additions and 6 deletions
+1 -1
Submodule l18n updated: fffe56da4a...963412a4d2
+94
View File
@@ -0,0 +1,94 @@
<?PHP
declare(strict_types = 1);
/**
* Represents a type of appointment documentation image.
*/
enum MDAppointmentImageCategory implements MDValueEnumInterface, JsonSerializable {
case advertising_material;
case photo_documentation;
/**
* Returns a value of this type based on a string.
*
* @param string $input Input to get a value from.
*
* @return MDAppointmentImageCategory
*/
public static function fromString(string $input):MDAppointmentImageCategory {
return match($input) {
'advertising_material' => self::advertising_material,
'photo_documentation' => self::photo_documentation,
default => throw new MDpageParameterNotFromListException("Unknown attendance status"),
};
}
/**
* Lists all available names.
*
* @return array<string>
*/
public static function caseNames():array {
$output = [];
$cases = self::cases();
foreach ($cases as $case) {
$output[] = $case->name;
}
return $output;
}
/**
* Gets an unsorted list of the entries in a translated version.
*
* @param MDTlLoader $tlLoader Translation loader.
*
* @return array<string, string>
*/
public static function getUnsortedList(MDTlLoader $tlLoader):array {
return MDValueSet::getTlUnsortedList($tlLoader, self::caseNames(), "appointment_image_category", "appointment_image_category");
}
/**
* Gets a sorted list of the entries in a translated version.
*
* @param MDTlLoader $tlLoader Translation loader.
*
* @return array<string, string>
*/
public static function getSortedList(MDTlLoader $tlLoader):array {
return MDValueSet::getTlSortedList($tlLoader, self::caseNames(), "appointment_image_category", "appointment_image_category");
}
/**
* Returns the name of the current value in translation.
*
* @param MDTlLoader $tlLoader Translation loader.
*
* @return string
*/
public function getTledName(MDTlLoader $tlLoader):string {
return $tlLoader->tl("appointment_image_category", "appointment_image_category", $this->name);
}
/**
* Provides the option to serialize as a string during json_encode().
*
* @return string
*/
public function jsonSerialize():string {
return $this->name;
}
}
-5
View File
@@ -1,9 +1,4 @@
<?PHP <?PHP
/**
* Represents a type of attendance status for events / appointments: offline or online.
*
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
*/
declare(strict_types = 1); declare(strict_types = 1);
/** /**