From 388f843144846da80a047e84e3a1bcbc55d42978 Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Fri, 7 Aug 2020 17:36:10 +0200 Subject: [PATCH] Add controlled list of entry types --- l18n | 2 +- src/MDEntryTypesSet.php | 47 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 src/MDEntryTypesSet.php diff --git a/l18n b/l18n index 6bcdd79..7a97fb5 160000 --- a/l18n +++ b/l18n @@ -1 +1 @@ -Subproject commit 6bcdd794ca934d73a2730c74056dd1e14ea64835 +Subproject commit 7a97fb5961d17e0bf4e6186a79e248fa62680350 diff --git a/src/MDEntryTypesSet.php b/src/MDEntryTypesSet.php new file mode 100644 index 0000000..5d7a458 --- /dev/null +++ b/src/MDEntryTypesSet.php @@ -0,0 +1,47 @@ + + */ +declare(strict_types = 1); + +/** + * Class containing available marking types. + */ +class MDEntryTypesSet extends MDValueSet { + + const ENTRY_TYPES = [ + '0', // + '1', // Schenkung + '2', // Kauf + '3', // Grabung + '4', // Notbergung + '5', // Erbschaft / Nachlass + '6', // Stiftung + '7', // Enteignung + '8', // Ursprungsbestand + '9', // Leihgabe + '10', // Tausch + '11', // Eigenproduktion + '12', // Material Strain (Törzsanyag) + '14', // Vorlass + '15', // Fund + '16', // Dauerleihgabe + '98', // Ungeklärt + '99', // Anderer rechtmäßiger Zugang + ]; + + /** + * Gets a sorted list of the entries in a translated version. + * + * @param MDTlLoader $tlLoader Translation loader. + * + * @return array + */ + public static function getSortedList(MDTlLoader $tlLoader):array { + return parent::getTlSortedList($tlLoader, self::ENTRY_TYPES, "entry_types", "entry_types"); + + } + +}