2023-06-05 15:28:27 +02:00
|
|
|
<?PHP
|
|
|
|
/**
|
|
|
|
* Constains lists for resolving literal ownership status to the expected names.
|
|
|
|
*
|
|
|
|
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
|
|
|
*/
|
|
|
|
declare(strict_types = 1);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Provides lists for categorizing spelled out ownership status types.
|
|
|
|
*/
|
|
|
|
final class MDConcOwnershipStatus implements MDImporterConcordanceListInterface {
|
|
|
|
|
|
|
|
private const OWNERSHIP_TYPES_VERBOSE = [
|
|
|
|
|
|
|
|
// 0: No known entry type
|
|
|
|
"Geschenk" => "owned",
|
2023-06-06 23:03:43 +02:00
|
|
|
"Dauerleihe" => "permanent_loan",
|
2023-06-05 15:28:27 +02:00
|
|
|
"Dauerleihgabe" => "permanent_loan",
|
|
|
|
"Kauf" => "owned",
|
|
|
|
"Fund" => "owned",
|
|
|
|
"Eigenleistung" => "owned",
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Require a function for getting the concordance target.
|
|
|
|
*
|
|
|
|
* @param string $input Input string.
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public static function getConcordanceTarget(string $input):string {
|
|
|
|
|
|
|
|
if (!isset(self::OWNERSHIP_TYPES_VERBOSE[$input])) {
|
|
|
|
throw new MDImporterMissingConcordance("Unknown ownership type: " . $input);
|
|
|
|
}
|
|
|
|
|
|
|
|
return self::OWNERSHIP_TYPES_VERBOSE[$input];
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|