MDImporterConcordanceLists/src/MDConcTime.php

61 lines
1.4 KiB
PHP
Raw Normal View History

<?PHP
/**
* Constains lists for grouping times.
*
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
*/
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,
2023-05-14 01:49:42 +02:00
"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];
}
}