Get availabale language base ID

@return int
336773
protected function _getAvailableLangBaseId()
    {
        $aBaseId = [];
        foreach ($this->_aLangData['params'] as $aLang) {
            $aBaseId[] = $aLang['baseId'];
        }

        $iNewId = 0;
        sort($aBaseId);
        $iTotal = count($aBaseId);

        //getting first available id
        while ($iNewId <= $iTotal) {
            if ($iNewId !== $aBaseId[$iNewId]) {
                break;
            }
            $iNewId++;
        }

        return $iNewId;
    }
320034
protected function getBaseLanguage()
    {
        $languageRepository = $this->languageManager->getLanguageRepository();

        // Tries to fetch the current language from the request
        if (null !== $this->request) {
            $languages = $this->request->getLanguages();

            $alLanguage = $languageRepository->fromLanguageName($languages[1]);
            if (null !== $alLanguage) {
                return $alLanguage;
            }
        // @codeCoverageIgnoreStart
        }
        // @codeCoverageIgnoreEnd

        // Fetches the current language from the main language when the adding one is not the main language
        if ($this->mainLanguage->getId() != $this->languageManager->get()->getId()) {
            return $this->mainLanguage;
        }

        return $languageRepository->firstOne();
    }
860353
public function getBaseUri()
    {
        if ($this->baseUri === null) {
            $this->baseUri = $this->detectBaseUri();
        }

        return $this->baseUri;
    }
1243530
protected function generateViewIdBase()
    {
        $languageId = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage();
        $currencyId = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getShopCurrency();

        return "ox|$languageId|$currencyId";
    }
1215008
public function getId()
	{
		$parts	= array();
		if( $this->category )
			$parts[]	= $this->category;
		if( $this->package )
			$parts[]	= $this->package;
#		$parts[]	= $this->parent->getBasename();
		$parts[]	= $this->name;
		return implode( "-", $parts );
	}
332591
public static function getAvailableLanguages(){
        $languages = array();
        foreach(common_ext_ExtensionsManager::singleton()->getInstalledExtensions() as $extension){
           $localesDir = $extension->getDir() . 'locales/';
           foreach(glob($localesDir . '*') as  $file){
                if(is_dir($file) && file_exists($file . '/messages.po')){
                    $lang = basename($file);
                    if(!in_array($lang, $languages)){
                        $languages[] = $lang;
                    }
                }
           }
        } 
        return $languages;
    }
1150343
public function getLanguageDatabase() : string
    {
        $pdo = $this->bot->getPDO();

        // Get the language from the bot
        $sth = $pdo->prepare('SELECT language FROM ' . $this->user_table . ' WHERE '
                                                           . $this->id_column . ' = :chat_id');

        $chat_id = $this->bot->chat_id;
        $sth->bindParam(':chat_id', $chat_id);

        try {
            $sth->execute();
        } catch (\PDOException $e) {
            throw new BotException($e->getMessage() . "/n" . $e->getLine());
        }

        $row = $sth->fetch();

        if (isset($row['language'])) {
            $this->language = $row['language'];
            return $row['language'];
        }

        $this->language = 'en';
        return 'en';
    }
427265
public function getLanguageID($id)
	{
		// normalize id
		$id = $this->getCanonicalID($id);
		// remove sub tags
		if(($underscorePosition=strpos($id, '_'))!== false)
		{
			$id = substr($id, 0, $underscorePosition);
		}
		return $id;
	}
1074046
public function getEditLanguage()
    {
        if ($this->_iEditLanguageId === null) {
            if (!$this->isAdmin()) {
                $this->_iEditLanguageId = $this->getBaseLanguage();
            } else {
                $iLang = null;
                // choosing language ident
                // check if we really need to set the new language
                if ("saveinnlang" == \OxidEsales\Eshop\Core\Registry::getConfig()->getActiveView()->getFncName()) {
                    $iLang = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("new_lang");
                }
                $iLang = ($iLang === null) ? \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('editlanguage') : $iLang;
                $iLang = ($iLang === null) ? \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('editlanguage') : $iLang;
                $iLang = ($iLang === null) ? $this->getBaseLanguage() : $iLang;

                // validating language
                $this->_iEditLanguageId = $this->validateLanguage($iLang);

                // writing to session
                \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('editlanguage', $this->_iEditLanguageId);
            }
        }

        return $this->_iEditLanguageId;
    }
1115541
public function getBaseType()
    {
        if ($this->base_type)
            return $this->base_type;
        if ($this->getParent())
            return $this->getParent()->getBaseType();
        return null;
    }
704620
private function getLanguages()
    {
        $directories = glob($this->basePath.'/*', GLOB_ONLYDIR);

        $languages = array_map(function ($dir) {
            $name = basename($dir);

            return in_array($name, $this->excluded, true) ? null : $name;
        }, $directories);

        return array_filter($languages);
    }
219638
public static function getAvailableLocalesInfo()
    {
        $languages = [];
        foreach (static::getAvailableLocales() as $id) {
            $languages[$id] = new Language($id);
        }

        return $languages;
    }
737689
public function id(): int
    {
        return app('cache.array')->rememberForever(__CLASS__ . __METHOD__ . $this->place_name, function (): int {
            // The "top-level" place won't exist in the database.
            if ($this->parts->isEmpty()) {
                return 0;
            }

            $parent_place_id = $this->parent()->id();

            $place_id = (int) DB::table('places')
                ->where('p_file', '=', $this->tree->id())
                ->where('p_place', '=', $this->parts->first())
                ->where('p_parent_id', '=', $parent_place_id)
                ->value('p_id');

            if ($place_id === 0) {
                $place = $this->parts->first();

                DB::table('places')->insert([
                    'p_file'        => $this->tree->id(),
                    'p_place'       => $place,
                    'p_parent_id'   => $parent_place_id,
                    'p_std_soundex' => Soundex::russell($place),
                    'p_dm_soundex'  => Soundex::daitchMokotoff($place),
                ]);

                $place_id = (int) DB::connection()->getPdo()->lastInsertId();
            }

            return $place_id;
        });
    }
200397
protected function getUpdateId(): int
    {
        if (!$this->updateId) {
            $data = $this->browse("DirectChildren");
            $this->updateId = $data["UpdateID"];
        }
        return $this->updateId;
    }
1281047
protected function getDocumentationLanguageId()
    {
        $language = \OxidEsales\Eshop\Core\Registry::getLang();
        $languageAbbr = $language->getLanguageAbbr($language->getTplLanguage());

        return $languageAbbr === "de" ? 0 : 1;
    }
701994
public function getBaseTypeId()
    {
        $value = $this->getFirstValue(PropertyIds::BASE_TYPE_ID);
        if (is_string($value)) {
            try {
                return BaseTypeId::cast($value);
            } catch (InvalidEnumerationValueException $e) {
                // invalid base type -> return null
            }
        }

        return null;
    }
905189
public function getLanguage()
    {
        if ($this->_iLanguage === null) {
            $this->_iLanguage = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage();
        }

        return $this->_iLanguage;
    }