From db240f9d3d312faf412487895cdde1a6a42c2795 Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Thu, 19 Aug 2021 00:44:15 +0200 Subject: [PATCH] Add MDActorVariantTypesSet for controlling variant types for actor names --- l18n | 2 +- src/MDActorVariantTypesSet.php | 36 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/MDActorVariantTypesSet.php diff --git a/l18n b/l18n index 1281aec..cfaa40e 160000 --- a/l18n +++ b/l18n @@ -1 +1 @@ -Subproject commit 1281aec3b152b85577ca709564736df3cc963cd3 +Subproject commit cfaa40ef385d3833f012071238463b8f8c155b94 diff --git a/src/MDActorVariantTypesSet.php b/src/MDActorVariantTypesSet.php new file mode 100644 index 0000000..db0a9d2 --- /dev/null +++ b/src/MDActorVariantTypesSet.php @@ -0,0 +1,36 @@ + + */ +declare(strict_types = 1); + +/** + * Class containing available types for actor name variants. E.g. birth names, + * married names, etc. + */ +final class MDActorVariantTypesSet extends MDValueSet { + + const ACTOR_VARIANT_TYPES = [ + '', + 'birth_name', + 'married_name', + 'monastic_name', + 'pseudonym', + 'regnal_name', + ]; + + /** + * Returns a translated list of name variants. + * + * @param MDTlLoader $tlLoader Translation loader. + * + * @return array + */ + public static function getActorVariantTypesTLed(MDTlLoader $tlLoader):array { + return parent::getTlUnsortedList($tlLoader, self::ACTOR_VARIANT_TYPES, "actor_variant_types_set", "actor_variant_types_set"); + + } +}