src/FilterSetting/Text.php
private function doSimpleSearch($strTextSearch, $objFilter, $arrFilterUrl)
    {
        $objMetaModel  = $this->getMetaModel();
        $objAttribute  = $objMetaModel->getAttributeById($this->get('attr_id'));
        $arrLanguages  = $this->getAvailableLanguages($objMetaModel);
        $strParamName  = $this->getParamName();
        $strParamValue = $arrFilterUrl[$strParamName];

        // React on wildcard, overriding the search type.
        if (strpos($strParamValue, '*') !== false) {
            $strTextSearch = 'exact';
        }

        // Type of search.
        switch ($strTextSearch) {
            case 'beginswith':
                $strWhat = $strParamValue . '*';
                break;
            case 'endswith':
                $strWhat = '*' . $strParamValue;
                break;
            case 'exact':
                $strWhat = $strParamValue;
                break;
            default:
                $strWhat = '*' . $strParamValue . '*';
                break;
        }

        if ($objAttribute && $strParamName && $strParamValue !== null) {
            $objFilter->addFilterRule(new SearchAttribute($objAttribute, $strWhat, $arrLanguages));

            return;
        }

        $objFilter->addFilterRule(new StaticIdList(null));
    }
private function doSimpleSearch($strTextSearch, $objFilter, $arrFilterUrl)
    {
        $objMetaModel  = $this->getMetaModel();
        $objAttribute  = $objMetaModel->getAttributeById($this->get('attr_id'));
        $arrLanguages  = $this->getAvailableLanguages($objMetaModel);
        $strParamName  = $this->getParamName();
        $strParamValue = $arrFilterUrl[$strParamName];

        // React on wildcard, overriding the search type.
        if (strpos($strParamValue, '*') !== false) {
            $strTextSearch = 'exact';
        }

        // Type of search.
        switch ($strTextSearch) {
            case 'beginswith':
                $strWhat = $strParamValue . '*';
                break;
            case 'endswith':
                $strWhat = '*' . $strParamValue;
                break;
            case 'exact':
                $strWhat = $strParamValue;
                break;
            default:
                $strWhat = '*' . $strParamValue . '*';
                break;
        }

        if ($objAttribute && $strParamName && $strParamValue !== null) {
            $objFilter->addFilterRule(new SearchAttribute($objAttribute, $strWhat, $arrLanguages));

            return;
        }

        $objFilter->addFilterRule(new StaticIdList(null));
    }
private function doSimpleSearch ( $ strTextSearch , $ objFilter , $ arrFilterUrl ) { $ objMetaModel = $ this -> getMetaModel ( ) ; $ objAttribute = $ objMetaModel -> getAttributeById ( $ this -> get ( 'attr_id' ) ) ; $ arrLanguages = $ this -> getAvailableLanguages ( $ objMetaModel ) ; $ strParamName = $ this -> getParamName ( ) ; $ strParamValue = $ arrFilterUrl [ $ strParamName ] ; // React on wildcard, overriding the search type. if ( strpos ( $ strParamValue , '*' ) !== false ) { $ strTextSearch = 'exact' ; } // Type of search. switch ( $ strTextSearch ) { case 'beginswith' : $ strWhat = $ strParamValue . '*' ; break ; case 'endswith' : $ strWhat = '*' . $ strParamValue ; break ; case 'exact' : $ strWhat = $ strParamValue ; break ; default : $ strWhat = '*' . $ strParamValue . '*' ; break ; } if ( $ objAttribute && $ strParamName && $ strParamValue !== null ) { $ objFilter -> addFilterRule ( new SearchAttribute ( $ objAttribute , $ strWhat , $ arrLanguages ) ) ; return ; } $ objFilter -> addFilterRule ( new StaticIdList ( null ) ) ; }
Make a simple search with a like.

@param string   $strTextSearch The mode for the search.

@param IFilter  $objFilter     The filter to append the rules to.

@param string[] $arrFilterUrl  The parameters to evaluate.

@return void
Make a simple search with a like .