return default query for the table.
if not in CMS mode return only active navigation trees.

@param int         $iLanguageId   - language used for query
@param bool|string $sFilterString - any filter conditions to add to the query

@return string
974822
public static function GetDefaultQuery($iLanguageId, $sFilterString = false)
    {
        $sDefaultQuery = 'SELECT `pkg_shop_primary_navi`.*
                          FROM `pkg_shop_primary_navi`
                         WHERE [{sFilterConditions}]
                      ORDER BY `pkg_shop_primary_navi`.`position` ASC';
        $sActivePrimaryNavigationQueryRestriction = '';
        if (!TGlobal::IsCMSMode()) {
            $sActivePrimaryNavigationQueryRestriction = TdbPkgShopPrimaryNaviList::GetActivePrimaryNavigationQueryRestriction();
        }
        if (strlen($sActivePrimaryNavigationQueryRestriction) > 0) {
            if (false === $sFilterString) {
                $sFilterString = " $sActivePrimaryNavigationQueryRestriction ";
            } else {
                $sFilterString = ' ( '.$sFilterString.' ) AND ('.$sActivePrimaryNavigationQueryRestriction.')';
            }
        } else {
            if (false === $sFilterString) {
                $sFilterString = ' 1 = 1 ';
            }
        }
        $sDefaultQuery = str_replace('[{sFilterConditions}]', $sFilterString, $sDefaultQuery);

        return $sDefaultQuery;
    }
1343975
public function findDefaultByContentLocale( $contentId,
                                                $locale,
                                                $preferredSubdomainId = null )
    {
        return $this->getMapper()
                    ->findDefaultByContentLocale(
                        $contentId,
                        $locale,
                        $preferredSubdomainId
                    );
    }
1310130
public function getCurrentUiLang($isTwoLetter = false) {
		$uiLcid3 = Configure::read('Config.language');
		if (empty($uiLcid3)) {
			$uiLcid3 = 'eng';
		}
		$uiLcid3 = mb_strtolower($uiLcid3);
		if (!$isTwoLetter) {
			return $uiLcid3;
		}

		return $this->convertLangCode($uiLcid3, 'iso639-1');
	}
1094766
public function getLoggingQueryQueryString($defaultIfEmpty = false)
    {
        $result = $this->getValueByPathOrDefaultValue('plugin.tx_solr.logging.query.queryString', $defaultIfEmpty);
        return $this->getBool($result);
    }
593594
private function getLogHeader($sCallFromFile, $iLineNumber)
    {
        $sOriginalURL = '';
        $sReferer = '';
        if (is_array($_SERVER) && array_key_exists('HTTP_REFERER', $_SERVER)) {
            $sReferer = $_SERVER['HTTP_REFERER'];
        }

        $sUserName = 'UNKNOWN USER';
        $request = $this->getCurrentRequest();
        $session = $request->getSession();

        if ($session && $session->isStarted()) {
            if (class_exists('TdbDataExtranetUser', false)) {
                $oUser = TdbDataExtranetUser::GetInstance();
                if ($oUser && !empty($oUser->fieldName)) {
                    $sUserName = $oUser->fieldName;
                }
            }
            $oSmartUrl = &TCMSSmartURLData::GetActive();
            if ($oSmartUrl) {
                $sOriginalURL = $oSmartUrl->sOriginalURL;
            } else {
                $sOriginalURL = $_SERVER['REQUEST_URI'];
            }
        } else {
            // no session - fill using normal data
            $sOriginalURL = $_SERVER['REQUEST_URI'];
        }

        $aData = array(
            date('Y-m-d H:i:s'),
            'PID: '.TTools::GetProcessId(),
            $request->getClientIp(),
            $sUserName,
            $sReferer,
            $sOriginalURL,
            'CALL: '.$sCallFromFile,
            'LINE: '.$iLineNumber,
        );

        return implode('|', $aData);
    }
1325240
protected function generateRedirectToDefaultSelection($categorySlug, $questionSlug)
    {
        $doRedirect = false;
        $config     = $this->container->getParameter('genj_faq');

        if (!$categorySlug && $config['select_first_category_by_default']) {
            $firstCategory = $this->getCategoryRepository()->retrieveFirst();
            if ($firstCategory instanceof \Genj\FaqBundle\Entity\Category) {
                $categorySlug = $firstCategory->getSlug();
                $doRedirect   = true;
            } else {
                throw $this->createNotFoundException('Tried to open the first faq category by default, but there was none.');
            }
        }

        if (!$questionSlug && $config['select_first_question_by_default']) {
            $firstQuestion = $this->getQuestionRepository()->retrieveFirstByCategorySlug($categorySlug);
            if ($firstQuestion instanceof \Genj\FaqBundle\Entity\Question) {
                $questionSlug = $firstQuestion->getSlug();
                $doRedirect   = true;
            } else {
                throw $this->createNotFoundException('Tried to open the first faq question by default, but there was none.');
            }
        }

        if ($doRedirect) {
            return $this->redirect(
                $this->generateUrl('genj_faq_faq_index', array('categorySlug' => $categorySlug, 'questionSlug' => $questionSlug), true)
            );
        }

        return false;
    }
722822
public function QueryLanguage()
    {
        $this->lexer->moveNext();

        switch ($this->lexer->lookahead['type']) {
            case Lexer::T_SELECT:
                $statement = $this->SelectStatement();
                break;

            case Lexer::T_UPDATE:
                $statement = $this->UpdateStatement();
                break;

            case Lexer::T_DELETE:
                $statement = $this->DeleteStatement();
                break;

            default:
                $this->syntaxError('SELECT, UPDATE or DELETE');
                break;
        }

        // Check for end of string
        if ($this->lexer->lookahead !== null) {
            $this->syntaxError('end of string');
        }

        return $statement;
    }
231039
public function getInfo($sName, $iLang = null)
    {
        if (isset($this->_aModule[$sName])) {
            if ($iLang !== null && is_array($this->_aModule[$sName])) {
                $sValue = null;

                $sLang = \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageAbbr($iLang);

                if (!empty($this->_aModule[$sName])) {
                    if (!empty($this->_aModule[$sName][$sLang])) {
                        $sValue = $this->_aModule[$sName][$sLang];
                    } elseif (!empty($this->_aModule['lang'])) {
                        // trying to get value according default language
                        $sValue = $this->_aModule[$sName][$this->_aModule['lang']];
                    } else {
                        // returning first array value
                        $sValue = reset($this->_aModule[$sName]);
                    }

                    return $sValue;
                }
            } else {
                return $this->_aModule[$sName];
            }
        }
    }
274795
protected function _getLanguageFileData($blAdmin = false, $iLang = 0, $aLangFiles = null)
    {
        $myUtils = \OxidEsales\Eshop\Core\Registry::getUtils();

        $sCacheName = $this->_getLangFileCacheName($blAdmin, $iLang, $aLangFiles);
        $aLangCache = $myUtils->getLangCache($sCacheName);
        if (!$aLangCache && $aLangFiles === null) {
            if ($blAdmin) {
                $aLangFiles = $this->_getAdminLangFilesPathArray($iLang);
            } else {
                $aLangFiles = $this->_getLangFilesPathArray($iLang);
            }
        }
        if (!$aLangCache && $aLangFiles) {
            $aLangCache = [];
            $sBaseCharset = $this->getTranslationsExpectedEncoding();
            $aLang = [];
            $aLangSeoReplaceChars = [];
            foreach ($aLangFiles as $sLangFile) {
                if (file_exists($sLangFile) && is_readable($sLangFile)) {
                    //$aSeoReplaceChars null indicates that there is no setting made
                    $aSeoReplaceChars = null;
                    include $sLangFile;

                    $aLang = array_merge(['charset' => 'UTF-8'], $aLang);

                    if (isset($aSeoReplaceChars) && is_array($aSeoReplaceChars)) {
                        $aLangSeoReplaceChars = array_merge($aLangSeoReplaceChars, $aSeoReplaceChars);
                    }

                    $aLangCache = array_merge($aLangCache, $aLang);
                }
            }

            $aLangCache['charset'] = $sBaseCharset;

            // special character replacement list
            $aLangCache['_aSeoReplaceChars'] = $aLangSeoReplaceChars;

            //save to cache
            $myUtils->setLangCache($sCacheName, $aLangCache);
        }

        return $aLangCache;
    }
270824
protected function _getLanguageMap($iLang, $blAdmin = null)
    {
        $blAdmin = isset($blAdmin) ? $blAdmin : $this->isAdmin();
        $sKey = $iLang . ((int) $blAdmin);
        if (!isset($this->_aLangMap[$sKey])) {
            $this->_aLangMap[$sKey] = [];
            $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

            $sMapFile = '';
            $sParentMapFile = $myConfig->getAppDir() . '/views/' . ($blAdmin ? 'admin' : $myConfig->getConfigParam("sTheme")) . '/' . \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageAbbr($iLang) . '/map.php';
            $sCustomThemeMapFile = $myConfig->getAppDir() . '/views/' . ($blAdmin ? 'admin' : $myConfig->getConfigParam("sCustomTheme")) . '/' . \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageAbbr($iLang) . '/map.php';

            if (file_exists($sCustomThemeMapFile) && is_readable($sCustomThemeMapFile)) {
                $sMapFile = $sCustomThemeMapFile;
            } elseif (file_exists($sParentMapFile) && is_readable($sParentMapFile)) {
                $sMapFile = $sParentMapFile;
            }

            if ($sMapFile) {
                include $sMapFile;
                $this->_aLangMap[$sKey] = $aMap;
            }
        }

        return $this->_aLangMap[$sKey];
    }
591673
public function getLanguageTag($iLanguage = null)
    {
        if (!isset($iLanguage)) {
            $iLanguage = $this->getBaseLanguage();
        }

        $iLanguage = (int) $iLanguage;

        return ($iLanguage) ? "_$iLanguage" : "";
    }
726782
public function setLanguage($iLanguage = null)
    {
        if (!isset($iLanguage)) {
            $this->_iLanguage = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage();
        } else {
            $this->_iLanguage = $iLanguage;
        }
    }
301135
public function getLoggingQuerySearchWords($defaultIfEmpty = false)
    {
        $result = $this->getValueByPathOrDefaultValue('plugin.tx_solr.logging.query.searchWords', $defaultIfEmpty);
        return $this->getBool($result);
    }
685448
protected function _getLangTranslationArray($iLang = null, $blAdmin = null, $aLangFiles = null)
    {
        startProfile("_getLangTranslationArray");

        $blAdmin = isset($blAdmin) ? $blAdmin : $this->isAdmin();
        $iLang = $this->_getCacheLanguageId($blAdmin, $iLang);
        $sCacheName = $this->_getLangFileCacheName($blAdmin, $iLang, $aLangFiles);

        if (!isset($this->_aLangCache[$sCacheName])) {
            $this->_aLangCache[$sCacheName] = [];
        }
        if (!isset($this->_aLangCache[$sCacheName][$iLang])) {
            // loading main lang files data
            $this->_aLangCache[$sCacheName][$iLang] = $this->_getLanguageFileData($blAdmin, $iLang, $aLangFiles);
        }

        stopProfile("_getLangTranslationArray");

        // if language array exists ..
        return (isset($this->_aLangCache[$sCacheName][$iLang]) ? $this->_aLangCache[$sCacheName][$iLang] : []);
    }
611552
public function getLoggingIndexingQueue($defaultIfEmpty = false)
    {
        $result = $this->getValueByPathOrDefaultValue('plugin.tx_solr.logging.indexing.queue', $defaultIfEmpty);
        return $this->getBool($result);
    }
615020
public function GetOrderByString($sDirection = null)
    {
        if (is_null($sDirection)) {
            $sDirection = $this->fieldOrderDirection;
        }
        $sOrderBy = '';
        if (!empty($this->fieldSqlOrderBy)) {
            $sOrderBy = $this->fieldSqlOrderBy.' '.$sDirection;
        }

        if (!empty($this->fieldSqlSecondaryOrderByString)) {
            $sOrderBy .= ', '.$this->fieldSqlSecondaryOrderByString;
        }

        return $sOrderBy;
    }
789010
public function findDefaultByContentLocale( $contentId,
                                                $locale,
                                                $preferredSubdomainId = null )
    {
        $locale = (string) $locale;
        $priLng = Locale::getPrimaryLanguage( $locale );

        if ( $priLng != $locale )
        {
            $locale = array( $locale, $priLng );
        }

        $platform = $this->getDbAdapter()
                         ->getPlatform();

        return $this->findOne( array(
            'contentId'     => $contentId,
            'locale'        => $locale,
        ), array(
            new Expression(
                'CASE ' . $platform->quoteIdentifier( 'subdomainId' ) .
                    ' WHEN ? THEN 1 ELSE 0 END DESC',
                array( (int) $preferredSubdomainId ),
                array( Expression::TYPE_VALUE )
            ),
            'locale'    => 'DESC',
            'default'   => 'DESC',
            'id'        => 'ASC',
        ) );
    }