*/ declare(strict_types = 1); /** * Represents a type of contribution to an exhibition. */ enum MDExhibitionContributorRole implements MDValueEnumInterface, JsonSerializable { case concept; case curator; case design; case coordinator; case protagonist; /** * Returns a value of this type based on a string. * * @param string $input Input to get a value from. * * @return MDExhibitionContributorRole */ public static function fromString(string $input):MDExhibitionContributorRole { return match($input) { "concept" => self::concept, "curator" => self::curator, "design" => self::design, "coordinator" => self::coordinator, "protagonist" => self::protagonist, default => throw new MDpageParameterNotFromListException("Unknown exhibition contributor role"), }; } /** * Returns a value of this type based on an integer. * * @param integer $input Input to get a value from. * * @return MDExhibitionContributorRole */ public static function fromInt(int $input):MDExhibitionContributorRole { return match($input) { 0 => self::concept, 1 => self::curator, 2 => self::design, 3 => self::coordinator, 4 => self::protagonist, default => throw new MDpageParameterNotFromListException("Unknown exhibition contributor role"), }; } /** * 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(), "exhibition_contributor_roles", "exhibition_contributor_roles"); } /** * 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(), "exhibition_contributor_roles", "exhibition_contributor_roles"); } /** * Lists all available names. * * @return array */ public static function caseInts():array { $output = []; $cases = self::cases(); foreach ($cases as $case) { $output[] = $case->toInt(); } return $output; } /** * Returns integer representation of object record status. * * @return integer */ public function toInt():int { return match($this) { self::concept => 0, self::curator => 1, self::design => 2, self::coordinator => 3, self::protagonist => 4, }; } /** * Returns canonical string representation of object record status. * * @return string */ public function toString():string { return match($this) { self::concept => 'concept', self::curator => 'curator', self::design => 'design', self::coordinator => 'coordinator', self::protagonist => 'protagonist', }; } /** * 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("exhibition_contributor_roles", "exhibition_contributor_roles", $this->name); } /** * Provides the option to serialize as a string during json_encode(). * * @return string */ public function jsonSerialize():string { return $this->name; } }