src/SearchBundle/objects/db/TShopSearchCache.class.php
public function GetSearchLink($aFilterAddition = array(), $aExcludeFilterKeys = array())
    {
        $sLink = '';

        $aParams = array();

        if (is_array($this->aSearchTerms) && count($this->aSearchTerms) > 0) {
            $aParams[TShopModuleArticlelistFilterSearch::PARAM_QUERY.'[0]'] = $this->sSearchTerm;
            reset($this->aSearchTerms);
            foreach ($this->aSearchTerms as $fieldId => $sVal) {
                $aParams[TShopModuleArticlelistFilterSearch::PARAM_QUERY."[{$fieldId}]"] = $sVal;
            }
            reset($this->aSearchTerms);
        } else {
            $aParams[TShopModuleArticlelistFilterSearch::PARAM_QUERY] = $this->sSearchTerm;
        }

        $aFilter = $this->GetCurrentFilter();
        if (!is_array($aFilter) && count($aFilterAddition) > 0) {
            $aFilter = array();
        }
        foreach ($aFilterAddition as $sFilterKey => $sFilterValue) {
            $aFilter[$sFilterKey] = $sFilterValue;
        }

        // add filter
        if (is_array($aFilter) && count($aFilter) > 0) {
            reset($aFilter);
            foreach ($aFilter as $sFilterKeyName => $sVal) {
                if (!in_array($sFilterKeyName, $aExcludeFilterKeys)) {
                    $aParams[TShopModuleArticlelistFilterSearch::URL_FILTER."[{$sFilterKeyName}]"] = $sVal;
                }
            }
        }

        $oShop = TdbShop::GetInstance();
        $sLink = $oShop->GetLinkToSystemPage('search', $aParams);

        return $sLink;
    }
public function GetSearchLink($aFilterAddition = array(), $aExcludeFilterKeys = array())
    {
        $sLink = '';

        $aParams = array();

        if (is_array($this->aSearchTerms) && count($this->aSearchTerms) > 0) {
            $aParams[TShopModuleArticlelistFilterSearch::PARAM_QUERY.'[0]'] = $this->sSearchTerm;
            reset($this->aSearchTerms);
            foreach ($this->aSearchTerms as $fieldId => $sVal) {
                $aParams[TShopModuleArticlelistFilterSearch::PARAM_QUERY."[{$fieldId}]"] = $sVal;
            }
            reset($this->aSearchTerms);
        } else {
            $aParams[TShopModuleArticlelistFilterSearch::PARAM_QUERY] = $this->sSearchTerm;
        }

        $aFilter = $this->GetCurrentFilter();
        if (!is_array($aFilter) && count($aFilterAddition) > 0) {
            $aFilter = array();
        }
        foreach ($aFilterAddition as $sFilterKey => $sFilterValue) {
            $aFilter[$sFilterKey] = $sFilterValue;
        }

        // add filter
        if (is_array($aFilter) && count($aFilter) > 0) {
            reset($aFilter);
            foreach ($aFilter as $sFilterKeyName => $sVal) {
                if (!in_array($sFilterKeyName, $aExcludeFilterKeys)) {
                    $aParams[TShopModuleArticlelistFilterSearch::URL_FILTER."[{$sFilterKeyName}]"] = $sVal;
                }
            }
        }

        $oShop = TdbShop::GetInstance();
        $sLink = $oShop->GetLinkToSystemPage('search', $aParams);

        return $sLink;
    }
public function GetSearchLink ( $ aFilterAddition = array ( ) , $ aExcludeFilterKeys = array ( ) ) { $ sLink = '' ; $ aParams = array ( ) ; if ( is_array ( $ this -> aSearchTerms ) && count ( $ this -> aSearchTerms ) > 0 ) { $ aParams [ TShopModuleArticlelistFilterSearch :: PARAM_QUERY . '[0]' ] = $ this -> sSearchTerm ; reset ( $ this -> aSearchTerms ) ; foreach ( $ this -> aSearchTerms as $ fieldId => $ sVal ) { $ aParams [ TShopModuleArticlelistFilterSearch :: PARAM_QUERY . "[{$fieldId}]" ] = $ sVal ; } reset ( $ this -> aSearchTerms ) ; } else { $ aParams [ TShopModuleArticlelistFilterSearch :: PARAM_QUERY ] = $ this -> sSearchTerm ; } $ aFilter = $ this -> GetCurrentFilter ( ) ; if ( ! is_array ( $ aFilter ) && count ( $ aFilterAddition ) > 0 ) { $ aFilter = array ( ) ; } foreach ( $ aFilterAddition as $ sFilterKey => $ sFilterValue ) { $ aFilter [ $ sFilterKey ] = $ sFilterValue ; } // add filter if ( is_array ( $ aFilter ) && count ( $ aFilter ) > 0 ) { reset ( $ aFilter ) ; foreach ( $ aFilter as $ sFilterKeyName => $ sVal ) { if ( ! in_array ( $ sFilterKeyName , $ aExcludeFilterKeys ) ) { $ aParams [ TShopModuleArticlelistFilterSearch :: URL_FILTER . "[{$sFilterKeyName}]" ] = $ sVal ; } } } $ oShop = TdbShop :: GetInstance ( ) ; $ sLink = $ oShop -> GetLinkToSystemPage ( 'search' , $ aParams ) ; return $ sLink ; }
return a search query based on the current filter.

@param array $aExcludeFilterKeys - any filter keys (same as in $this->aFilter) you place in here
will be excluded from the link

@return string
return a search query based on the current filter .