*/ declare(strict_types = 1); /** * Provides a list for finding the respective event type for a given time role. */ final class MDConcTime implements MDImporterConcordanceListInterface { private const TIME_ROLES_TO_EVENT_TYPE = [ # General / not yet (?) categorized "Laufzeit" => 24, # Production "Herstellungsjahr" => 1, "Herst.-Zeitraum" => 1, "Herstellungsjahr (Nachbau)" => 1, "Datierung" => 1, "Produktionszeitraum" => 1, # Template creation "Datierung der Vorlage" => 4, "Herstellungsjahr (Original)" => 4, # Recording / Image taken "Datierung der Aufnahme" => 10, // Was issued "Ausfertigungsdatum" => 14, # Printing "Druckdatum" => 26, # Intellectual creation "Entwurf" => 35, ]; /** * Require a function for getting the concordance target. * * @param string $input Input string. * * @return integer */ public static function getConcordanceTarget(string $input):int { if (!isset(self::TIME_ROLES_TO_EVENT_TYPE[$input])) { throw new MDImporterMissingConcordance("Unknown time type: " . $input); } return self::TIME_ROLES_TO_EVENT_TYPE[$input]; } }