library/Garp/Browsebox.php
public function setFilter($filterId, array $params = array()) {
        if (!array_key_exists($filterId, $this->_options['filters'])) {
            throw new Garp_Browsebox_Exception('Filter "'.$filterId.'" not found in browsebox '.$this->getId().'.');
        }
        $filter = $this->_options['filters'][$filterId];
        $filter->init($params);
        
        try {
            $filter->modifySelect($this->_select);
        } catch (Garp_Browsebox_Filter_Exception_NotApplicable $e) {
            // It's okay, this filter makes no modifications to the Select object
        }

        // save the custom filters as a property so they can be sent along in the URL
        $this->_filters[$filterId] = $params;
        return $this;
    }
public function setFilter($filterId, array $params = array()) {
        if (!array_key_exists($filterId, $this->_options['filters'])) {
            throw new Garp_Browsebox_Exception('Filter "'.$filterId.'" not found in browsebox '.$this->getId().'.');
        }
        $filter = $this->_options['filters'][$filterId];
        $filter->init($params);
        
        try {
            $filter->modifySelect($this->_select);
        } catch (Garp_Browsebox_Filter_Exception_NotApplicable $e) {
            // It's okay, this filter makes no modifications to the Select object
        }

        // save the custom filters as a property so they can be sent along in the URL
        $this->_filters[$filterId] = $params;
        return $this;
    }
public function setFilter ( $ filterId , array $ params = array ( ) ) { if ( ! array_key_exists ( $ filterId , $ this -> _options [ 'filters' ] ) ) { throw new Garp_Browsebox_Exception ( 'Filter "' . $ filterId . '" not found in browsebox ' . $ this -> getId ( ) . '.' ) ; } $ filter = $ this -> _options [ 'filters' ] [ $ filterId ] ; $ filter -> init ( $ params ) ; try { $ filter -> modifySelect ( $ this -> _select ) ; } catch ( Garp_Browsebox_Filter_Exception_NotApplicable $ e ) { // It's okay, this filter makes no modifications to the Select object } // save the custom filters as a property so they can be sent along in the URL $ this -> _filters [ $ filterId ] = $ params ; return $ this ; }
Add custom filtering to WHERE clause
@param String $filterId Key in $this->_options['filters']
@param Array $params Filter values (by order of $this->_options['filters'][$filterId])
@return Garp_Browsebox $this
Add custom filtering to WHERE clause