public function setQuerystring(array $str = array(), $append = true, $default = true)
	{
		if ( is_null($this->filterable) ) {
			$this->resetFilterableOptions();	
		}
		if ( sizeof($str) == 0 && $default ) {
			// Default to PHP query string
			parse_str($_SERVER['QUERY_STRING'], $this->filterable['qstring']);
		} else {
			$this->filterable['qstring'] = $str;	
		}
		if ( sizeof($this->filterable['qstring']) > 0 ) {
			if ( !$append ) {
				// Overwrite data
				$this->filterable['filters'] = array();
			}
			foreach ( $this->filterable['qstring'] as $k => $v ) {
				if ( $v == '' ) {
					continue;
				}
				$thisColumn = isset($this->filterable['columns'][$k]) ? $this->filterable['columns'][$k] : false;
				if ( $thisColumn ) {
					// Query string part matches column (or alias)
					$this->filterable['filters'][$thisColumn]['val'] = $v;
					// Evaluate boolean parameter in query string
					$thisBoolData = isset($this->filterable['qstring']['bool'][$k]) ? $this->filterable['qstring']['bool'][$k] : false;
					$thisBoolAvailable = $thisBoolData && isset($this->filterable['bools'][$thisBoolData]) ? $this->filterable['bools'][$thisBoolData] : false;
					if ( $thisBoolData && $thisBoolAvailable ) {
						$this->filterable['filters'][$thisColumn]['boolean'] = $thisBoolAvailable;
					} else {
						$this->filterable['filters'][$thisColumn]['boolean'] = $this->filterable['defaultWhere'];
					}
					// Evaluate operator parameters in the query string
					if ( isset($this->filterable['qstring']['operator'][$k]) && in_array($this->filterable['qstring']['operator'][$k], $this->filterable['operators']) ) {
						$this->filterable['filters'][$thisColumn]['operator'] = $this->filterable['qstring']['operator'][$k];
					} else {
						// Default operator
						$this->filterable['filters'][$thisColumn]['operator'] = $this->filterable['defaultOperator'];
					}
				}
			}
		}
		return $this;
	}
public function setQuerystring(array $str = array(), $append = true, $default = true)
	{
		if ( is_null($this->filterable) ) {
			$this->resetFilterableOptions();	
		}
		if ( sizeof($str) == 0 && $default ) {
			// Default to PHP query string
			parse_str($_SERVER['QUERY_STRING'], $this->filterable['qstring']);
		} else {
			$this->filterable['qstring'] = $str;	
		}
		if ( sizeof($this->filterable['qstring']) > 0 ) {
			if ( !$append ) {
				// Overwrite data
				$this->filterable['filters'] = array();
			}
			foreach ( $this->filterable['qstring'] as $k => $v ) {
				if ( $v == '' ) {
					continue;
				}
				$thisColumn = isset($this->filterable['columns'][$k]) ? $this->filterable['columns'][$k] : false;
				if ( $thisColumn ) {
					// Query string part matches column (or alias)
					$this->filterable['filters'][$thisColumn]['val'] = $v;
					// Evaluate boolean parameter in query string
					$thisBoolData = isset($this->filterable['qstring']['bool'][$k]) ? $this->filterable['qstring']['bool'][$k] : false;
					$thisBoolAvailable = $thisBoolData && isset($this->filterable['bools'][$thisBoolData]) ? $this->filterable['bools'][$thisBoolData] : false;
					if ( $thisBoolData && $thisBoolAvailable ) {
						$this->filterable['filters'][$thisColumn]['boolean'] = $thisBoolAvailable;
					} else {
						$this->filterable['filters'][$thisColumn]['boolean'] = $this->filterable['defaultWhere'];
					}
					// Evaluate operator parameters in the query string
					if ( isset($this->filterable['qstring']['operator'][$k]) && in_array($this->filterable['qstring']['operator'][$k], $this->filterable['operators']) ) {
						$this->filterable['filters'][$thisColumn]['operator'] = $this->filterable['qstring']['operator'][$k];
					} else {
						// Default operator
						$this->filterable['filters'][$thisColumn]['operator'] = $this->filterable['defaultOperator'];
					}
				}
			}
		}
		return $this;
	}
public function setQuerystring ( array $ str = array ( ) , $ append = true , $ default = true ) { if ( is_null ( $ this -> filterable ) ) { $ this -> resetFilterableOptions ( ) ; } if ( sizeof ( $ str ) == 0 && $ default ) { // Default to PHP query string parse_str ( $ _SERVER [ 'QUERY_STRING' ] , $ this -> filterable [ 'qstring' ] ) ; } else { $ this -> filterable [ 'qstring' ] = $ str ; } if ( sizeof ( $ this -> filterable [ 'qstring' ] ) > 0 ) { if ( ! $ append ) { // Overwrite data $ this -> filterable [ 'filters' ] = array ( ) ; } foreach ( $ this -> filterable [ 'qstring' ] as $ k => $ v ) { if ( $ v == '' ) { continue ; } $ thisColumn = isset ( $ this -> filterable [ 'columns' ] [ $ k ] ) ? $ this -> filterable [ 'columns' ] [ $ k ] : false ; if ( $ thisColumn ) { // Query string part matches column (or alias) $ this -> filterable [ 'filters' ] [ $ thisColumn ] [ 'val' ] = $ v ; // Evaluate boolean parameter in query string $ thisBoolData = isset ( $ this -> filterable [ 'qstring' ] [ 'bool' ] [ $ k ] ) ? $ this -> filterable [ 'qstring' ] [ 'bool' ] [ $ k ] : false ; $ thisBoolAvailable = $ thisBoolData && isset ( $ this -> filterable [ 'bools' ] [ $ thisBoolData ] ) ? $ this -> filterable [ 'bools' ] [ $ thisBoolData ] : false ; if ( $ thisBoolData && $ thisBoolAvailable ) { $ this -> filterable [ 'filters' ] [ $ thisColumn ] [ 'boolean' ] = $ thisBoolAvailable ; } else { $ this -> filterable [ 'filters' ] [ $ thisColumn ] [ 'boolean' ] = $ this -> filterable [ 'defaultWhere' ] ; } // Evaluate operator parameters in the query string if ( isset ( $ this -> filterable [ 'qstring' ] [ 'operator' ] [ $ k ] ) && in_array ( $ this -> filterable [ 'qstring' ] [ 'operator' ] [ $ k ] , $ this -> filterable [ 'operators' ] ) ) { $ this -> filterable [ 'filters' ] [ $ thisColumn ] [ 'operator' ] = $ this -> filterable [ 'qstring' ] [ 'operator' ] [ $ k ] ; } else { // Default operator $ this -> filterable [ 'filters' ] [ $ thisColumn ] [ 'operator' ] = $ this -> filterable [ 'defaultOperator' ] ; } } } } return $ this ; }
Parse the query string

@param $str array The query string
@param $append Append or overwrite existing query string data
@param $default Default to $_SERVER['QUERY_STRING'] if $str isn't given

@return $this
Parse the query string