diff --git a/l18n b/l18n index 963412a..38eb440 160000 --- a/l18n +++ b/l18n @@ -1 +1 @@ -Subproject commit 963412a4d2c4a247904fbbaee7a6e8e348c290e2 +Subproject commit 38eb44046b89404d45abed551cdb804fc3b4b52a diff --git a/src/enums/MDAppointmentRecordingHoster.php b/src/enums/MDAppointmentRecordingHoster.php new file mode 100644 index 0000000..38fa6c2 --- /dev/null +++ b/src/enums/MDAppointmentRecordingHoster.php @@ -0,0 +1,104 @@ + 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 + */ + 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 + */ + 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 + */ + 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(); + + } +} diff --git a/src/enums/MDAppointmentRecordingType.php b/src/enums/MDAppointmentRecordingType.php new file mode 100644 index 0000000..1db1ae2 --- /dev/null +++ b/src/enums/MDAppointmentRecordingType.php @@ -0,0 +1,92 @@ + self::video, + default => throw new MDpageParameterNotFromListException("Unknown appointment recording type"), + }; + + } + + /** + * Lists all available names. + * + * @return array + */ + 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 + */ + public static function getUnsortedList(MDTlLoader $tlLoader):array { + return MDValueSet::getTlUnsortedList($tlLoader, self::caseNames(), "appointment_recording_types", "appointment_recording_types"); + + } + + /** + * Gets a sorted list of the entries in a translated version. + * + * @param MDTlLoader $tlLoader Translation loader. + * + * @return array + */ + public static function getSortedList(MDTlLoader $tlLoader):array { + return MDValueSet::getTlSortedList($tlLoader, self::caseNames(), "appointment_recording_types", "appointment_recording_types"); + + } + + /** + * 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_types", "appointment_recording_types", $this->name); + + } + + /** + * Provides the option to serialize as a string during json_encode(). + * + * @return string + */ + public function jsonSerialize():string { + + return $this->name; + + } +}