diff --git a/src/enums/MDSeriesContributorRole.php b/src/enums/MDSeriesContributorRole.php index b4fb74d..49b5530 100644 --- a/src/enums/MDSeriesContributorRole.php +++ b/src/enums/MDSeriesContributorRole.php @@ -59,6 +59,37 @@ enum MDSeriesContributorRole implements MDValueEnumInterface, JsonSerializable { } + /** + * Returns a value of this type based on an integer. + * + * @param integer $input Input to get a value from. + * + * @return MDSeriesContributorRole + */ + public static function fromInt(int $input):MDSeriesContributorRole { + + return match($input) { + 0 => self::author, + 1 => self::director, + 2 => self::dramaturg, + 3 => self::production_designer, + 4 => self::costumer, + 5 => self::musician, + 6 => self::choreographer, + 7 => self::make_up_artist, + 8 => self::speech_trainer, + 9 => self::puppet_maker, + 10 => self::technician, + 11 => self::inspector, + 12 => self::assistant, + 13 => self::actor, + 14 => self::painter, + 15 => self::creator, + default => throw new MDpageParameterNotFromListException("Unknown attendance status"), + }; + + } + /** * Lists all available names. * @@ -85,7 +116,7 @@ enum MDSeriesContributorRole implements MDValueEnumInterface, JsonSerializable { * @return array */ public static function getUnsortedList(MDTlLoader $tlLoader):array { - return MDValueSet::getTlUnsortedList($tlLoader, self::caseNames(), "attendance_status_set", "attendance_status_set"); + return MDValueSet::getTlUnsortedList($tlLoader, self::caseNames(), "series_contributor_role", "series_contributor_role"); } @@ -97,7 +128,7 @@ enum MDSeriesContributorRole implements MDValueEnumInterface, JsonSerializable { * @return array */ public static function getSortedList(MDTlLoader $tlLoader):array { - return MDValueSet::getTlSortedList($tlLoader, self::caseNames(), "attendance_status_set", "attendance_status_set"); + return MDValueSet::getTlSortedList($tlLoader, self::caseNames(), "series_contributor_role", "series_contributor_role"); } @@ -157,7 +188,7 @@ enum MDSeriesContributorRole implements MDValueEnumInterface, JsonSerializable { */ public function getTledName(MDTlLoader $tlLoader):string { - return $tlLoader->tl("attendance_status_set", "attendance_status_set", $this->name); + return $tlLoader->tl("series_contributor_role", "series_contributor_role", $this->name); }