Get CMS Page Link Object.

@param integer $navId
@param string $target
@param string $lang
@return \luya\cms\menu\Item|boolean
175881
public function getPageLink($navId, $target, $lang = null)
    {
        $linkQuery = Yii::$app->menu->find();
        $linkQuery->where(['nav_id' => $navId]);
        $linkQuery->with(['hidden']);
        if ($lang) {
            $linkQuery->lang($lang);
        }
        $link = $linkQuery->one();
        
        // if a page is found, set the target value from the config.
        if ($link) {
            $link->setTarget($target);
        }
        
        return $link;
    }
730257
public function getOnlineChildren(Node $parent, $lang = null)
    {
        return $this->getOnlineChildrenQueryBuilder($parent, $lang)
            ->getQuery()->getResult();
    }
894528
private function getPageMap(string $sourceLanguage, string $targetLanguage): PageMap
    {
        if (!array_key_exists($key = $sourceLanguage . '->' . $targetLanguage, $this->pageMaps)) {
            return $this->pageMaps[$key] = new PageMap(
                $sourceLanguage,
                $targetLanguage,
                $this->database,
                $this->logger
            );
        }

        return $this->pageMaps[$key];
    }
213222
public static function link($menu, $text, array $options = [], array $fields = [])
    {
        if ($menu instanceof ActiveRecord) {

            if (!$fields) {
                $fields = self::$fields;
            }

            if ($menu->{$fields['page_blank']}) {
                $options['target'] = '_blank';
            }

            return Html::a($text, self::linkUrl(
                $menu->{$fields['page_id']},
                $menu->{$fields['page_url']}
            ), $options);
        }

        return false;
    }
998378
public function getTemplateUrl($file = null, $admin = false, $ssl = null, $lang = null)
    {
        return $this->getShopMainUrl() . $this->getDir($file, $this->_sTemplateDir, $admin, $lang, null, null, false);
    }
1365909
public function parseBlock(Text $content, Container $target)
    {
        $content->handle(
            '{
                ^
                [ ]{0,3}\[(.+)\]:  # id = $1
                  [ \t]*
                  \n?               # maybe *one* newline
                  [ \t]*
                (?|                 # url = $2
                  ([^\s<>]+)            # either without spaces
                  |
                  <([^<>\\n]*)>         # or enclosed in angle brackets
                )
                (?:
                  [ \t]*
                  \n?               # maybe one newline
                  [ \t]*
                    (?<=\s)         # lookbehind for whitespace
                    ["\'(]
                    (.+?)           # title = $3
                    ["\')]
                    [ \t]*
                )?  # title is optional
                $
            }xm',
            function (Text $whole, Text $id, Text $url, Text $title = null) use ($target) {
                if (! $this->queue->isEmpty()) {
                    $lastPart = $this->queue->dequeue();

                    // If the previous line was not empty, we should not parse this as a link reference
                    if (! $lastPart->match('/(^|\n *)\n$/')) {
                        $lastPart->append($whole);
                        $this->queue->enqueue($lastPart);
                        return;
                    }

                    $this->parsePart($lastPart, $target);
                }

                $id = $id->lower()->getString();

                // Throw away duplicate reference definitions
                if ( ! $this->links->exists($id)) {
                    $url->decodeEntities();

                    // Replace special characters in the URL
                    $url->encodeUrl();

                    $this->links->set($id, $url);

                    if ($title) {
                        $title->decodeEntities();
                        $this->titles->set($id, $title);
                    }
                }
            },
            function (Text $part) {
                if (! $this->queue->isEmpty()) {
                    $lastPart = $this->queue->dequeue();
                    $part->prepend($lastPart);
                }

                $this->queue->enqueue($part);
            }
        );

        if (! $this->queue->isEmpty()) {
            $lastPart = $this->queue->dequeue();
            $this->parsePart($lastPart, $target);
        }
    }
621078
private function identifyRequest($target = false)
    {
        $retval = false;

        $this->locateURI();

        $nb_engine = CNabuEngine::getEngine();

        if ($target) {
            $temp_target = CNabuSiteTarget::findByURL($this->nb_site, $this->page_uri);
            if ($temp_target instanceof CNabuSiteTarget && $temp_target->isValueNumeric('nb_language_id')) {
                $nb_language = new CNabuLanguage($temp_target);
                if ($nb_language->isFetched()) {
                    $this->nb_language = $nb_language;
                } else {
                    $this->nb_language = $this->nb_site->getDefaultLanguage();
                }
            }

            if (!($target instanceof CNabuSiteTarget) &&
                is_numeric($nb_site_target_id = nb_getMixedValue($target, 'nb_site_target_id'))
            ) {
                $target = new CNabuSiteTarget($nb_site_target_id);
                if ($target->isFetched()) {
                    $this->nb_site_target = $target;
                }
            } else {
                $this->nb_site_target = $target;
            }
            if ($this->nb_site_target instanceof CNabuSiteTarget &&
                $this->nb_language === null && $this->nb_site_target->isValueNumeric('nb_language_id')) {
                $this->nb_language = new CNabuLanguage($this->nb_site_target->getValue('nb_language_id'));
                if ($this->nb_language->isNew()) {
                    $this->nb_language = null;
                }
            }
            if ($this->nb_language === null) {
                $this->nb_language = $this->nb_site->getDefaultLanguage();
            }
            if ($this->nb_site_target !== null &&
                $this->nb_language !== null &&
                $this->nb_site_target->hasTranslation($this->nb_language)
            ) {
                $this->nb_response->setHTTPResponseCode(200);
                $nb_engine->traceLog('Page Status', 'Found');

                $retval = true;
            }
        } elseif ($this->findTargetByURL($this->page_uri)) {
            $nb_engine->traceLog("Page ID", $this->nb_site_target->getId());

            if ($this->nb_language === null) {
                throw new ENabuCoreException(ENabuCoreException::ERROR_LANGUAGE_NOT_FOUND_FOR_PAGE_URI);
            }
            $nb_engine->traceLog("Page language", $this->nb_language->getISO6391());
            $nb_engine->traceLog('Page Status', 'Found');

            $retval = true;
        }

        if (!($this->nb_site_target instanceof CNabuSiteTarget) || !$retval) {
            $nb_engine->traceLog('Page Status', 'Not found');
            $link = $this->nb_site->getPageNotFoundTargetLink();
            if ($link->isLinkable()) {
                if ($link->isTranslatedTarget()) {
                    $this->nb_language = $this->nb_site->getDefaultLanguage();
                    if ($this->nb_language instanceof CNabuLanguage &&
                        ($nb_site_target = $link->getTranslatedObject()) instanceof CNabuSiteTarget &&
                        ($nb_site_target->getTranslation($this->nb_language) instanceof CNabuSiteTargetLanguage)
                    ) {
                        $this->nb_site_target = $nb_site_target;
                        $retval = true;
                    }
                }
            }

            if ($this->nb_response->getHTTPResponseCode() === 0) {
                $this->nb_response->setHTTPResponseCode(404);
            }
        }

        return $retval;
    }
822559
public function getLanguageAbbr($iLanguage = null)
    {
        if ($this->_aLangAbbr === null) {
            $this->_aLangAbbr = $this->getLanguageIds();
        }

        $iLanguage = isset($iLanguage) ? (int) $iLanguage : $this->getBaseLanguage();
        if (isset($this->_aLangAbbr[$iLanguage])) {
            $iLanguage = $this->_aLangAbbr[$iLanguage];
        }

        return $iLanguage;
    }
184641
public function actionRender($id, $lang = null, $params = '')
    {
        if (empty($lang)) $lang = Yii::$app->language;
        $langHelper = $this->module->langHelper;
        $lang = $langHelper::normalizeLangCode($lang);

        if (is_numeric($id)) {
            $contentId = $id;
        } else {
            $contentId = $this->model->getIdBySlugPath($id);
        }

        if (empty($contentId)) {
            $msg = __METHOD__ . ": illegal id = '$id'.";
            Yii::error($msg);
            return '';
        }
        $node = $this->model->node($contentId);
        if (empty($node)) {
            $msg = __METHOD__ . ": node id='{$contentId}' not found.";
            Yii::error($msg);
            return '';
        }

        if (isset($node->i18n[$lang]->text)) {
            if ($node->is_visible) {
                $text = $node->i18n[$lang]->text;
            } else {
                $text = '';
                $msg = __METHOD__ . ": for node id='{$contentId}' disable visibility.";
                Yii::trace($msg);
                return '';
            }
        } else {
            $msg = __METHOD__ . ": for node id='{$contentId}', lang='$lang' not found text.";
            Yii::error($msg);
            return '';
        }

        // processing parameters in format '{{param}}', translation table get from unserialized $params
        $defParams = $this->getDefaultParams($node, $lang);
        $params = @unserialize($params);
        if (!is_array($params)) { // $params must be array (on error unserialize() return false)
            $params = [];
        }
        $params = ArrayHelper::merge($defParams, $params);
        $text = TextProcessor::textPreprocess($text, $params);
        return $text;
    }
64822
public static function a(string $text, string $target = null): string
    {
        return preg_replace('@((https?://)?([-\w]+\.[-\w\.]+)+\w(:\d+)?(/([-\w/_\.]*(\?\S+)?)?)*)@',
          "<a href=\"\$1\"" . ($target != null ? " target=\"{$target}\"" : '') . ">$1</a>", $text);
    }
210360
protected function getContentUri(Content $content, $lang = null)
    {
        return sprintf(
            '%s/api/ezp/v2/ez_recommendation/v1/content/%s%s',
            // @todo normalize in configuration
            $this->options['server-uri'],
            $content->id,
            isset($lang) ? '?lang=' . $lang : ''
        );
    }
510992
public function href(string $controller = null, string $action = null, array $params = null, string $lang = null): string
    {
        return $this->siteHref('', $controller, $action, $params, $lang);
    }
786848
public function url($url, $target = '')
    {
        $this->urlTarget = $target;
        $this->url = $url;

        return $this->setNotifier();
    }
1011260
public function getTarget($nb_site_target)
    {
        $nb_site_target_id = nb_getMixedValue($nb_site_target, 'nb_site_target_id');

        return (is_numeric($nb_site_target_id) || nb_isValidGUID($nb_site_target_id))
               ? $this->nb_site_target_list->getItem($nb_site_target_id)->setSite($this)
               : null
        ;
    }
1058387
public function getBaseStdLink($iLang, $blAddId = true, $blFull = true)
    {
        if (!isset($this->_aBaseStdUrls[$iLang][$iLinkType])) {
            $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
            $oArticle->setId($this->getId());
            $oArticle->setLinkType($iLinkType);
            $this->_aBaseStdUrls[$iLang][$iLinkType] = $oArticle->getBaseStdLink($iLang, $blAddId, $blFull);
        }

        return $this->_aBaseStdUrls[$iLang][$iLinkType];
    }
351309
public function getCTAs($force = false)
    {
        if ($this->nb_site_target_cta_list->isEmpty() || $force) {
            $this->nb_site_target_cta_list->clear();
            $this->nb_site_target_cta_list->merge(CNabuSiteTargetCTA::getSiteTargetCTAs($this));
            $translations = CNabuSiteTargetCTALanguage::getCTATranslationsForSiteTarget($this);
            if (is_array($translations) && count($translations) > 0) {
                foreach ($translations as $translation) {
                    $nb_site_target_cta = $this->nb_site_target_cta_list->getItem($translation->getSiteTargetCTAId());
                    if ($nb_site_target_cta instanceof CNabuSiteTargetCTA) {
                        $nb_site_target_cta->setTranslation($translation);
                    }
                }
            }
            $roles = CNabuSiteTargetCTARole::getCTARolesForSiteTarget($this);
            if (is_array($roles) && count($roles) > 0) {
                foreach ($roles as $role) {
                    $nb_site_target_cta = $this->nb_site_target_cta_list->getItem($role->getSiteTargetCTAId());
                    if ($nb_site_target_cta instanceof CNabuSiteTargetCTA) {
                        $nb_site_target_cta->addRole($role);
                    }
                }
            }
        }

        return $this->nb_site_target_cta_list;
    }
1247295
public function getEmailDetailsByEmailId($emailId, $langId = null){
        $select = $this->tableGateway->getSql()->select();
        
        $select->where('boed_email_id ='.$emailId);
        if($langId != null){
            $select->where('boed_lang_id ='.$langId);
        }
        
        $resultSet = $this->tableGateway->selectWith($select);
        return $resultSet;
    }