Extend concordance lists for measurement types, ownership

This commit is contained in:
2024-12-18 16:58:43 +01:00
parent 7fef0f0ada
commit a97557640b
2 changed files with 71 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ final class MDConcOwnershipStatus implements MDImporterConcordanceListInterface
private const OWNERSHIP_TYPES_VERBOSE = [
// 0: No known entry type
"Eigentum" => "owned",
"Geschenk" => "owned",
"Besitz" => "owned",
"Dauerleihe" => "permanent_loan",
@@ -23,6 +24,14 @@ final class MDConcOwnershipStatus implements MDImporterConcordanceListInterface
"Eigenleistung" => "owned",
"Eigentum des Museums" => "owned",
// Permanent loans
"Dauerleihe" => "permanent_loan",
"Dauerleihgabe" => "permanent_loan",
// Loans
"Leihe" => "borrowed",
"Leihgabe" => "borrowed",
];
/**
@@ -35,6 +44,9 @@ final class MDConcOwnershipStatus implements MDImporterConcordanceListInterface
public static function getConcordanceTarget(string $input):string {
if (!isset(self::OWNERSHIP_TYPES_VERBOSE[$input])) {
if (isset(self::OWNERSHIP_TYPES_VERBOSE[trim($input)])) {
return self::OWNERSHIP_TYPES_VERBOSE[trim($input)];
}
throw new MDImporterMissingConcordance("Unknown ownership type: " . $input);
}