Files
MDImporterConcordanceLists/src/MDConcOwnershipStatus.php
T
2026-09-02 18:43:19 +02:00

85 lines
2.5 KiB
PHP

<?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
"Eigentum" => "owned",
"EigentumZCOM" => "owned",
"Geschenk" => "owned",
"Besitz" => "owned",
"Owned" => "owned",
"owned" => "owned",
"Kauf" => "owned",
"Fund" => "owned",
"Eigenleistung" => "owned",
"Eigentum des Museums" => "owned",
"Eigentum des Museums - TEST" => "owned",
"j" => "owned",
"+" => "owned",
"EigentumForum" => "owned",
"Eigentum Land Berlin" => "owned",
// Permanent loans
"Dauerleihe" => "permanent_loan",
"Dauerleihgabe" => "permanent_loan",
"Permanent loan" => "permanent_loan",
"permanent loan" => "permanent_loan",
// Loans
"Leihe" => "borrowed",
"Leihgabe" => "borrowed",
"Ensemble soll bei Umzug des Möbeldepots an Senat zurückgegeben werden (Jan. 2009)" => "borrowed",
"Leihgabe 13.8.96" => "borrowed",
// Owned by others => third_party_property
'Third party property' => 'third_party_property',
'Fremdeigentum' => 'third_party_property',
// Deaccessed
'Deaccessed' => 'deaccessed',
'deakzessioniert' => 'deaccessed',
'Deakzessioniert' => 'deaccessed',
'Deakzession' => 'deaccessed',
'Deakzessiert' => 'deaccessed',
// To check
'ungeklärt' => 'to_check',
// None
'k.A.' => '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])) {
if (isset(self::OWNERSHIP_TYPES_VERBOSE[trim($input)])) {
return self::OWNERSHIP_TYPES_VERBOSE[trim($input)];
}
MDImporterMissingConcordance::throw("ownership", $input);
return 'deaccessed'; // Return default in dry-run mode
}
return self::OWNERSHIP_TYPES_VERBOSE[$input];
}
}