From 5abbecfad78a82e6dbf8ded27481436f57b079b0 Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Thu, 6 Aug 2020 21:05:40 +0200 Subject: [PATCH] Add MDPlacetypesSet for controlling place types --- l18n | 2 +- src/MDPlacetypesSet.php | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 src/MDPlacetypesSet.php diff --git a/l18n b/l18n index 3ba5f74..4b2c9ff 160000 --- a/l18n +++ b/l18n @@ -1 +1 @@ -Subproject commit 3ba5f740e6da9d45eefcb10a4981178dd35631a8 +Subproject commit 4b2c9ffee40ae15164b282177faabde441271821 diff --git a/src/MDPlacetypesSet.php b/src/MDPlacetypesSet.php new file mode 100644 index 0000000..a8988f3 --- /dev/null +++ b/src/MDPlacetypesSet.php @@ -0,0 +1,37 @@ + + */ + +/** + * Class containing available place types. + */ +class MDPlacetypesSet extends MDValueSet { + + const PLACE_TYPE_IDS = [ + '0', // => Administrativ + '1', // => Historisch + '2', // => Region - Landschaft - Naturpark + '3', // => Straße - Platz + '4', // => Bauwerk - Gebäude - Stadtpark - Kanal + '5', // => Berg - Gebirge + '6', // => Wald - Forst + '7', // => Fluss - See - Meer + '8', // => Insel - Atoll + ]; + + /** + * Gets a 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::PLACE_TYPE_IDS, "placetypes", "tlPlacetypes"); + + } + +}