105 lines
2.5 KiB
PHP
105 lines
2.5 KiB
PHP
<?PHP
|
|
declare(strict_types = 1);
|
|
|
|
/**
|
|
* Represents an allowed hoster for videos of events.
|
|
*/
|
|
enum MDAppointmentRecordingHoster implements MDValueEnumInterface, JsonSerializable {
|
|
|
|
case archive_org;
|
|
|
|
/**
|
|
* Returns a value of this type based on a string.
|
|
*
|
|
* @param string $input Input to get a value from.
|
|
*
|
|
* @return MDAppointmentRecordingHoster
|
|
*/
|
|
public static function fromString(string $input):MDAppointmentRecordingHoster {
|
|
|
|
return match($input) {
|
|
'archive_org' => self::archive_org,
|
|
'Archive.org' => self::archive_org,
|
|
default => throw new MDpageParameterNotFromListException("Unknown hoster"),
|
|
};
|
|
|
|
}
|
|
|
|
/**
|
|
* To string.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function toString():string {
|
|
return match($this) {
|
|
self::archive_org => 'Archive.org',
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Lists all available names.
|
|
*
|
|
* @return array<string>
|
|
*/
|
|
public static function caseNames():array {
|
|
|
|
$output = [];
|
|
|
|
$cases = self::cases();
|
|
foreach ($cases as $case) {
|
|
$output[] = $case->toString();
|
|
}
|
|
|
|
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_recording_hoster", "appointment_recording_hoster");
|
|
|
|
}
|
|
|
|
/**
|
|
* 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_recording_hoster", "appointment_recording_hoster");
|
|
|
|
}
|
|
|
|
/**
|
|
* 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_recording_hoster", "appointment_recording_hoster", $this->toString());
|
|
|
|
}
|
|
|
|
/**
|
|
* Provides the option to serialize as a string during json_encode().
|
|
*
|
|
* @return string
|
|
*/
|
|
public function jsonSerialize():string {
|
|
|
|
return $this->toString();
|
|
|
|
}
|
|
}
|