36 lines
783 B
PHP
36 lines
783 B
PHP
|
<?PHP
|
||
|
/**
|
||
|
* Constains lists for grouping sexes.
|
||
|
*
|
||
|
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||
|
*/
|
||
|
declare(strict_types = 1);
|
||
|
|
||
|
/**
|
||
|
* Constains lists for grouping sexes.
|
||
|
*/
|
||
|
final class MDConcSex implements MDImporterConcordanceListInterface {
|
||
|
|
||
|
private const SEXES_LIST = [
|
||
|
'Männlich' => 'male',
|
||
|
'diverse' => 'other',
|
||
|
];
|
||
|
|
||
|
/**
|
||
|
* 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::SEXES_LIST[$input])) {
|
||
|
throw new MDImporterMissingConcordance("Unknown sex type: " . $input);
|
||
|
}
|
||
|
|
||
|
return self::SEXES_LIST[$input];
|
||
|
|
||
|
}
|
||
|
}
|