2022-04-02 00:55:38 +02:00
|
|
|
<?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.
|
|
|
|
*/
|
2023-05-14 12:11:23 +02:00
|
|
|
final class MDConcTime implements MDImporterConcordanceListInterface {
|
2022-04-02 00:55:38 +02:00
|
|
|
|
2023-05-14 12:11:23 +02:00
|
|
|
private const TIME_ROLES_TO_EVENT_TYPE = [
|
2022-04-02 00:55:38 +02:00
|
|
|
|
|
|
|
# General / not yet (?) categorized
|
|
|
|
"Laufzeit" => 24,
|
|
|
|
|
|
|
|
# Production
|
|
|
|
"Herstellungsjahr" => 1,
|
|
|
|
"Herst.-Zeitraum" => 1,
|
|
|
|
"Herstellungsjahr (Nachbau)" => 1,
|
|
|
|
"Datierung" => 1,
|
2023-05-14 12:20:10 +02:00
|
|
|
"Produktionszeitraum" => 1,
|
2022-04-02 00:55:38 +02:00
|
|
|
|
|
|
|
# Template creation
|
|
|
|
"Datierung der Vorlage" => 4,
|
2023-05-14 01:49:42 +02:00
|
|
|
"Herstellungsjahr (Original)" => 4,
|
2022-04-02 00:55:38 +02:00
|
|
|
|
|
|
|
# Recording / Image taken
|
|
|
|
"Datierung der Aufnahme" => 10,
|
|
|
|
|
|
|
|
// Was issued
|
|
|
|
"Ausfertigungsdatum" => 14,
|
|
|
|
|
|
|
|
# Printing
|
|
|
|
"Druckdatum" => 26,
|
|
|
|
|
|
|
|
# Intellectual creation
|
|
|
|
"Entwurf" => 35,
|
|
|
|
|
|
|
|
];
|
|
|
|
|
2023-05-14 12:11:23 +02:00
|
|
|
/**
|
|
|
|
* 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];
|
|
|
|
|
|
|
|
}
|
2022-04-02 00:55:38 +02:00
|
|
|
}
|