Returns firs found Apache_Solr_Document for current page by given language id.

@param $languageId
@return Document|false
359915
public function findOneByPageIdAndByLanguageId($pageId, $languageId)
    {
        $documentCollection = $this->findByPageIdAndByLanguageId($pageId, $languageId);
        return reset($documentCollection);
    }
1117327
static function fetch( $id )
    {
        $languages = eZContentLanguage::fetchList();

        return isset( $languages[$id] )? $languages[$id]: false;
    }
818494
public function getRawObjectByUid(int $uid, int $languageUid = 0, array $querySettings = ['respectSysLanguage' => false]) {
    if ($uid && $uid > 0) {
      // Create a new query.
      $query = $this->createquery();

      // Set the passend language UID.
      $settings = $query->getQuerySettings();
      $settings->setLanguageUid($languageUid);

      // Apply the passed query settings.
      $query = $this->applyQuerySettings($query, $querySettings);

      // Set the query constraints.
      $query->matching($query->equals('uid', $uid));

      // Execute the query and get raw object.
      $result = $query->execute(true);

      return $result[0];
    }

    return null;
  }
1048727
public function loadLanguageById($languageId)
    {
        $language = $this->languageHandler->load($languageId);

        return $this->buildDomainObject($language);
    }
188515
public function getMenu($menuTypeId, $language = null)
    {
        if( is_null($language) ) {
            $language = app()->getLocale();
        }

        if( $this->cacheEnabled ) {
            $cacheName = self::getCacheName($menuTypeId, $language);

            if( Cache::has($cacheName) ) {
                return Cache::get($cacheName);
            }
        }

        return $this->getMenuItems($menuTypeId, $language);
    }
1350249
public function checkIfpageShouldBeIndexed($uid, $language_uid)
    {
        $index = true;

        if ($this->cachedPageRecords[$language_uid][$uid]['hidden']) {
            $index = false;
        }

        if ($this->cachedPageRecords[$language_uid][$uid]['no_search']) {
            $index = false;
        }

        if (!in_array($this->cachedPageRecords[$language_uid][$uid]['doktype'], $this->indexDokTypes)) {
            $index = false;
        }

        return $index;
    }
523465
private Long getLanguageId(final String _language)
    {
        Long ret = null;
        try {
            final QueryBuilder queryBldr = new QueryBuilder(CIAdmin.Language);
            queryBldr.addWhereAttrEqValue(CIAdmin.Language.Language, _language);
            final InstanceQuery query = queryBldr.getQuery();
            query.executeWithoutAccessCheck();
            if (query.next()) {
                ret = query.getCurrentValue().getId();
            } else {
                ret = insertNewLanguage(_language);
            }
        } catch (final EFapsException e) {
            DBPropertiesUpdate.LOG.error("getLanguageId()", e);
        }
        return ret;
    }
513483
public function getVendorUrl($vendor, $languageId = null)
    {
        if (!isset($languageId)) {
            $languageId = $vendor->getLanguage();
        }

        return $this->_getFullUrl($this->getVendorUri($vendor, $languageId), $languageId);
    }
993536
public function actionSave($id = null, $languageId)
    {
        if (!empty($languageId)) {
            if (!empty($id)) {

                $model = $this->findModel($id);
                if (empty($model)) {
                    throw new NotFoundHttpException;
                }
                $modelTranslation = $this->findModelTranslation($id, $languageId);
                if (empty($modelTranslation)) {
                    $modelTranslation = new ProductAvailabilityTranslation();
                }
            }
            else {
                $model = new ProductAvailability();
                $modelTranslation = new ProductAvailabilityTranslation();
            }
        }
        else throw new BadRequestHttpException();


        if ($modelTranslation->load(Yii::$app->request->post())) {

            $model->save(false);

            $modelTranslation->availability_id = $model->id;
            $modelTranslation->language_id = $languageId;
            if ($modelTranslation->validate()) {

                $modelTranslation->save();
                $this->trigger(self::EVENT_AFTER_CREATE_OR_UPDATE_PRODUCT_AVAILABILITY,
                    new ProductAvailabilityEvent(['availability' => $model]));

                return $this->redirect(['save', 'id' => $model->id, 'languageId' => $languageId]);
            }
        }
        return $this->render('save', [
            'model' => $model,
            'modelTranslation' => $modelTranslation,
            'languages' => Language::find()->all(),
            'selectedLanguage' => Language::findOne($languageId)
        ]);

    }
413260
public static function searchFaceText($faceId)
    {
        if (false !== ($key = array_search($faceId, static::$faceIndexs))) {
            return isset(static::$faceTexts[$key]) ? static::$faceTexts[$key] : null;
        }

        return null;
    }
15955
private function locateLanguageFile($localeID)
    {
        $localeIDAlternatives = $this->getLocaleIDAlternatives($localeID);
        $result = null;
        foreach ($localeIDAlternatives as $localeIDAlternative) {
            $languageFile = $this->getLanguageFilePath($localeIDAlternative);
            if (is_file($languageFile)) {
                $result = $languageFile;
                break;
            }
        }

        return $result;
    }
1037402
public function newRevision($language_id = null)
    {
        $created = new static($language_id ?: $this->language_id);
        $created->content = $this->content;

        return $created;
    }
1320962
public function findTranslationOverlaysByPageId(int $pageId) : array
    {
        $queryBuilder = $this->getQueryBuilder();
        $queryBuilder->getRestrictions()->removeAll();
        $queryBuilder->getRestrictions()->add(GeneralUtility::makeInstance(DeletedRestriction::class));

        return $queryBuilder
            ->select('pid', 'l10n_parent', 'sys_language_uid')
            ->from('pages')
            ->add('where',
                $queryBuilder->expr()->eq('l10n_parent', $queryBuilder->createNamedParameter($pageId, \PDO::PARAM_INT))
                . BackendUtility::BEenableFields('pages')
            )->execute()->fetchAll();

    }
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);
    }
831647
public function findOneById($seoId)
    {
        $qb = $this->createQueryBuilder('s');
        $query = $qb
            ->andWhere($qb->expr()->eq('s.id', $seoId))
            ->setMaxResults(1)
            ->getQuery()
            //->useResultCache(true, 3600, 'ekyna_cms.seo[id:'.$seoId.']') // TODO doctrine cache clear/update
        ;
        return $query->getOneOrNullResult();
    }
1014772
public function getCurrentPage(int $languageUid = null) {
    $uid = intval($GLOBALS['TSFE']->id);

    return $this->getPage($uid, $languageUid);
  }
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,
                ]
            ));
    }