Added helper method to retrieve content language ids
authorAlexander Ebert <ebert@woltlab.com>
Wed, 23 Aug 2017 11:39:12 +0000 (13:39 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 23 Aug 2017 11:39:12 +0000 (13:39 +0200)
wcfsetup/install/files/lib/system/language/LanguageFactory.class.php

index 4f3a675a330a51a63f2bbbb73299657be25c4876..18919304c980cd1a2b4f7e41067bc352b6347714 100644 (file)
@@ -280,6 +280,23 @@ class LanguageFactory extends SingletonFactory {
                return $availableLanguages;
        }
        
+       /**
+        * Returns the list of content language ids.
+        * 
+        * @return      integer[]
+        * @since       3.1
+        */
+       public function getContentLanguageIDs() {
+               $languageIDs = [];
+               foreach ($this->getLanguages() as $language) {
+                       if ($language->hasContent) {
+                               $languageIDs[] = $language->languageID;
+                       }
+               }
+               
+               return $languageIDs;
+       }
+       
        /**
         * Makes given language the default language.
         *