This service searches a value for matching page name or page id

@param int $langId language id

@return array language locales
433238
public function getLocaleByLangId($langId)
    {
        // Event parameters prepare
        $arrayParameters = $this->makeArrayFromParameters(__METHOD__, func_get_args());

        // Sending service start event
        $arrayParameters = $this->sendEvent('melisengine_service_get_local_by_id_start', $arrayParameters);

        // Service implementation start
        $langTable = $this->getServiceLocator()->get('MelisEngineTableCmsLang');
        $result = $langTable->getEntryByField('lang_cms_id', $langId)->toArray();
        if(!isset($result[0]['lang_cms_locale'])) return null;
        $result = $result[0]['lang_cms_locale'];
        // Service implementation end

        // Adding results to parameters for events treatment if needed
        $arrayParameters['results'] = $result;
        // Sending service end event
        $arrayParameters = $this->sendEvent('melisengine_service_get_local_by_id_end', $arrayParameters);

        return $arrayParameters['results'];
    }
83023
public function get($entityId, $lang = 'en') 
    {
        if(!is_qid($entityId)) {
            throw new Exception("First argument in get() must by a valid Wikidata entity ID (e.g.: Q646).", 1);
        }

        $query = '
            SELECT ?item ?itemLabel ?itemDescription ?itemAltLabel ?prop ?propLabel (GROUP_CONCAT(DISTINCT ?valueLabel;separator=", ") AS ?propValue) WHERE { 
                  BIND(wd:'.$entityId.' AS ?item).
                  ?prop wikibase:directClaim ?p .
                  ?item ?p ?value .
                  SERVICE wikibase:label { 
                    bd:serviceParam wikibase:language "'.$lang.'". 
                    ?value rdfs:label ?valueLabel . 
                    ?prop rdfs:label ?propLabel . 
                    ?item rdfs:label ?itemLabel . 
                    ?item skos:altLabel ?itemAltLabel . 
                    ?item schema:description ?itemDescription . 
                  }    
                } group by ?item ?itemLabel ?itemDescription ?itemAltLabel ?prop ?propLabel
        '; 

        $client = new SparqlClient();

        $data = $client->execute($query); 

        if(!$data) {
            return null;
        }

        $entity = new Entity($data, $lang);

        return $entity;
    }
628181
public function getLanguage($vocabulary_id, $language_id = null)
    {
        if (!$this->isTranslatable($vocabulary_id)) {
            return 1;
        }

        if ($language_id === null) {
            return I18N::getCurrentId();
        }

        return $language_id;
    }
2168
public function lookUpLanguageIdForLocale($locale)
    {
        $locale = $this->normalizeLocale($locale);

        /** @var Model $languageModel */
        $languageModel = static::$cmsLanguageModel;

        $language = $languageModel::where(config('pxlcms.translatable.locale_code_column'), $locale)
            ->remember((config('pxlcms.cache.languages', 15)))
            ->first();

        if (empty($language)) return null;

        return $language->id;
    }
242953
public static function getChildPageIds($pageId)
    {
        if (empty(self::$preloaded_page_children)) {
            foreach (static::preloadArray() as $key => $page) {
                if (!isset(self::$preloaded_page_children[$page->parent])) {
                    self::$preloaded_page_children[$page->parent] = [];
                }
                self::$preloaded_page_children[$page->parent][] = $page->id;
            }
        }
        return !empty(self::$preloaded_page_children[$pageId]) ? self::$preloaded_page_children[$pageId] : [];
    }
184159
public function getUserInfo(string $openId, string $lang = 'zh_CN')
    {
        return $this->curl->get(self::GET.$this->access_token.'&'.http_build_query([
                    'openid' => $openId,
                    'lang' => $lang,
                ]
            ));
    }
227786
public function findOneLanguageTitleByLanguageId(int $languageId) : string
    {
        $queryBuilder = $this->getQueryBuilder();
        $result = $queryBuilder->select('title')
            ->from($this->table)
            ->where($queryBuilder->expr()->eq('uid', $languageId))
            ->execute()->fetch();

        if ($result == false && $languageId == 0) {
            return 'default';
        }

        return isset($result['title']) ? $result['title'] : '';
    }
1170304
public function actionNavLangItem($navId, $langId)
    {
        $item = NavItem::find()->with('nav')->where(['nav_id' => $navId, 'lang_id' => $langId])->one();
        if ($item) {
            return [
                'error' => false,
                'item' => $item->toArray(),
                'nav' => $item->nav->toArray(),
                'typeData' => ($item->nav_item_type == 1) ? NavItemPage::getVersionList($item->id) : ArrayHelper::typeCast($item->getType()->toArray()),
            ];
        }
        
        return ['error' => true];
    }
654790
protected function _getLanguageInfo($sOxId)
    {
        $sDefaultLang = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sDefaultLang');

        $aLangData = $this->_aLangData['params'][$sOxId];
        $aLangData['abbr'] = $sOxId;
        $aLangData['desc'] = $this->_aLangData['lang'][$sOxId];
        $aLangData['baseurl'] = $this->_aLangData['urls'][$aLangData['baseId']];
        $aLangData['basesslurl'] = $this->_aLangData['sslUrls'][$aLangData['baseId']];
        $aLangData['default'] = ($this->_aLangData['params'][$sOxId]["baseId"] == $sDefaultLang) ? true : false;

        return $aLangData;
    }
1279554
public function getLink($languageId = null)
    {
        return $this->_addPageNrParam($this->getBaseLink($languageId), $this->getActPage(), $languageId);
    }
322773
protected function initializeSearch($pageId, $languageId = 0)
    {
        if (!is_int($pageId)) {
            throw new \InvalidArgumentException('Invalid page ID = ' . $pageId, 1487332926);
        }
        if (!is_int($languageId)) { // @todo: Check if lang id is defined and present?
            throw new \InvalidArgumentException('Invalid language ID = ' . $languageId, 1487335178);
        }
        /* @var $connectionManager ConnectionManager */
        $connectionManager = GeneralUtility::makeInstance(ConnectionManager::class);
        $solrConnection = $connectionManager->getConnectionByPageId($pageId, $languageId);

        $this->search = $this->getSearch($solrConnection);
    }
1138464
public function getPageByUid(int $uid, int $languageUid = null) {
    return $this->getPage($uid, $languageUid);
  }
725017
protected function _setLocale( $site, $langid = null, $currencyid = null )
	{
		$siteManager = MShop_Locale_Manager_Factory::createManager( $this->_context )->getSubManager( 'site' );

		$search = $siteManager->createSearch();
		$search->setConditions( $search->compare( '==', 'locale.site.code', $site ) );
		$sites = $siteManager->searchItems( $search );

		if ( ( $siteItem = reset( $sites ) ) === false ) {
			throw new Controller_ExtJS_Exception( sprintf( 'Site item for code "%1$s" not found', $site ) );
		}

		$values = array( 'siteid' => $siteItem->getId() );
		$sitepath = array_keys( $siteManager->getPath( $siteItem->getId() ) );
		$sitetree = $this->_getSiteIdsFromTree( $siteManager->getTree( $siteItem->getId() ) );

		$localeItem = new MShop_Locale_Item_Default( $values, $siteItem, $sitepath, $sitetree );
		$localeItem->setLanguageId( $langid );
		$localeItem->setCurrencyId( $currencyid );

		$this->_context->setLocale( $localeItem );
	}
359098
private function getPageMetas($pageId)
    {
        $pageMetas = array();
        $metas = $this->getDoctrine()->getRepository('FulgurioLightCMSBundle:PageMeta')->findByPage($pageId);
        foreach ($metas as $meta)
        {
            $pageMetas[$meta->getMetaKey()] = $meta;
        }
        return $pageMetas;
    }
1170868
public function resolve_language_url($currentPageID, $sectionID)
    {
        $resolve = ['/'];
        $lang = Section::getByID((int) $sectionID);
        if (is_object($lang)) {
            $resolve = [$lang];
            $page = \Page::getByID((int) $currentPageID);
            if (!$page->isError()) {
                $relatedID = $lang->getTranslatedPageID($page);
                if ($relatedID) {
                    $pc = \Page::getByID($relatedID);
                    $resolve = [$pc];
                } elseif ($page->isGeneratedCollection()) {
                    $this->app->make('session')->set('multilingual_default_locale', $lang->getLocale());
                    $resolve = [$page];
                }
            }
        }

        return $this->app->make(ResolverManagerInterface::class)->resolve($resolve);
    }
313381
private function loadLocationEntriesMatchingMultipleLanguages($locationId, array $languageIds)
    {
        // note: alwaysAvailable for this use case is not relevant
        $languageMask = $this->languageMaskGenerator->generateLanguageMaskFromLanguageIds(
            $languageIds,
            false
        );

        $connection = $this->dbHandler->getConnection();
        /** @var \Doctrine\DBAL\Connection $connection */
        $query = $connection->createQueryBuilder();
        $query
            ->select('id', 'lang_mask', 'parent', 'text_md5')
            ->from($this->table)
            ->where('action = :action')
            // fetch rows matching any of the given Languages
            ->andWhere('lang_mask & :languageMask <> 0')
            ->setParameter(':action', 'eznode:' . $locationId)
            ->setParameter(':languageMask', $languageMask)
        ;

        $statement = $query->execute();
        $rows = $statement->fetchAll(\PDO::FETCH_ASSOC);

        return $rows ?: [];
    }
1092566
public static function getList($rootPid, $languageId = null)
    {
        $sitemapList = array();
        $pageList    = array();

        $typo3Pids = array();

        $query = 'SELECT ts.*
                    FROM tx_metaseo_sitemap ts
                            INNER JOIN pages p
                              ON    p.uid = ts.page_uid
                                AND p.deleted = 0
                                AND p.hidden = 0
                                AND p.tx_metaseo_is_exclude = 0
                                AND ' . DatabaseUtility::conditionNotIn('p.doktype', self::getDoktypeBlacklist()) . '
                   WHERE ts.page_rootpid = ' . (int)$rootPid . '
                     AND ts.is_blacklisted = 0';

        if ($languageId !== null) {
            $query .= ' AND ts.page_language = ' . (int)$languageId;
        }
        $query .= ' ORDER BY
                        ts.page_depth ASC,
                        p.pid ASC,
                        p.sorting ASC';
        $resultRows = DatabaseUtility::getAll($query);

        if (!$resultRows) {

            return self::getListArray(); //empty
        }

        foreach ($resultRows as $row) {
            $sitemapList[] = $row;

            $sitemapPageId             = $row['page_uid'];
            $typo3Pids[$sitemapPageId] = (int)$sitemapPageId;
        }

        if (!empty($typo3Pids)) {
            $query    = 'SELECT *
                           FROM pages
                          WHERE ' . DatabaseUtility::conditionIn('uid', $typo3Pids);
            $pageList = DatabaseUtility::getAllWithIndex($query, 'uid');

            if (empty($pageList)) {

                return self::getListArray(); //empty
            }
        }

        return self::getListArray($sitemapList, $pageList);
    }