code/LeftAndMain.php
protected function getSearchFilter()
    {
        if ($this->searchFilterCache) {
            return $this->searchFilterCache;
        }

        // Check for given FilterClass
        $params = $this->getRequest()->getVar('q');
        if (empty($params['FilterClass'])) {
            return null;
        }

        // Validate classname
        $filterClass = $params['FilterClass'];
        $filterInfo = new ReflectionClass($filterClass);
        if (!$filterInfo->implementsInterface(LeftAndMain_SearchFilter::class)) {
            throw new InvalidArgumentException(sprintf('Invalid filter class passed: %s', $filterClass));
        }

        return $this->searchFilterCache = Injector::inst()->createWithArgs($filterClass, array($params));
    }
protected function getSearchFilter()
    {
        if ($this->searchFilterCache) {
            return $this->searchFilterCache;
        }

        // Check for given FilterClass
        $params = $this->getRequest()->getVar('q');
        if (empty($params['FilterClass'])) {
            return null;
        }

        // Validate classname
        $filterClass = $params['FilterClass'];
        $filterInfo = new ReflectionClass($filterClass);
        if (!$filterInfo->implementsInterface(LeftAndMain_SearchFilter::class)) {
            throw new InvalidArgumentException(sprintf('Invalid filter class passed: %s', $filterClass));
        }

        return $this->searchFilterCache = Injector::inst()->createWithArgs($filterClass, array($params));
    }
protected function getSearchFilter ( ) { if ( $ this -> searchFilterCache ) { return $ this -> searchFilterCache ; } // Check for given FilterClass $ params = $ this -> getRequest ( ) -> getVar ( 'q' ) ; if ( empty ( $ params [ 'FilterClass' ] ) ) { return null ; } // Validate classname $ filterClass = $ params [ 'FilterClass' ] ; $ filterInfo = new ReflectionClass ( $ filterClass ) ; if ( ! $ filterInfo -> implementsInterface ( LeftAndMain_SearchFilter :: class ) ) { throw new InvalidArgumentException ( sprintf ( 'Invalid filter class passed: %s' , $ filterClass ) ) ; } return $ this -> searchFilterCache = Injector :: inst ( ) -> createWithArgs ( $ filterClass , array ( $ params ) ) ; }
Gets the current search filter for this request, if available

@throws InvalidArgumentException
@return LeftAndMain_SearchFilter
Gets the current search filter for this request if available