Class miTableFilters

Description

Filters support class

  • copyright: Copyright (c) 2006 Mirchev Ideas Ltd. All rights reserved.

Located in /view/TableFilters.php (line 15)

miTableFeature
   |
   --miTableFilters
Class Constant Summary
 FILTER_CONDITION_SUFFIX = 'Condition'
 FILTER_NAME_SUFFIX = 'Filter'
Variable Summary
Method Summary
void addAdditionalFilter (string $field, string $value, string $condition)
void createFilterObj (string $field, string $value, string $condition)
array getFilterObjs ()
string getFilterValue (string $filterName)
array getFilterValues ()
array getStateParams ()
array getValues ()
void setConditionHandler (string $condition, string $handlerClassName)
void setDefaultFilterValues (array $defaultFilterValues)
Variables
array $_additionalFilters = array() (line 34)

Additional filters added by application logic

  • access: protected
array $_conditionMap = array(
'=' => 'miSqlFilterEqual',
'!=' => 'miSqlFilterNotEqual',
'>' => 'miSqlFilterBiggerThan',
'>=' => 'miSqlFilterBiggerOrEqual',
'<' => 'miSqlFilterSmallerThan',
'<=' => 'miSqlFilterSmallerOrEqual',
'substring' => 'miSqlFilterSubstring',
'starts' => 'miSqlFilterStarts',
'ends' => 'miSqlFilterEnds',
'regexp' => 'miSqlFilterRegExp',
'in' => 'miSqlFilterIn',
'notin' => 'miSqlFilterNotIn',
)
(line 43)

Map between the filter conditions and the actual filter class

  • access: protected
array $_defaultFilterValues = array() (line 25)

An associative array with filter field and value

  • access: protected

Inherited Variables

Inherited from miTableFeature

miTableFeature::$_table
Methods
addAdditionalFilter (line 90)

Adds an additional filter

  • access: public
void addAdditionalFilter (string $field, string $value, string $condition)
  • string $field
  • string $value
  • string $condition
createFilterObj (line 258)

Creates a filter object The object depends on the $condition

  • throws: miConfigurationException
  • access: protected
void createFilterObj (string $field, string $value, string $condition)
  • string $field: the filter field
  • string $value
  • string $condition
getFilterObjs (line 232)

Returns an array of filter objects

  • return: array of objects, subclasses of miSqlFilter
  • throws: miConfigurationException
  • access: public
array getFilterObjs ()
getFiltersFromRequest (line 195)

Gets all filter parameters from the request

Returns the additional filters along with the filters from the request Uses $_REQUEST superglobal instead of $_GET or $_POST Note: Value and Condition can be arrays

  • return: array of arrays that each holding the field name[0], value[1] and condition[2]
  • throws: miConfigurationException
  • access: public
array getFiltersFromRequest ()
getFilterValue (line 124)

Returns the filter value of $filterName The request is checked first, then the default filter values, and if the $filterName cannot not found returns empty string

TODO: improve efficiency by not using getFilterValues()

  • return: the filter value
  • access: public
string getFilterValue (string $filterName)
  • string $filterName
getFilterValues (line 102)

The the current filters values

  • return: associative array with each filter and it's value
  • throws: miConfigurationException
  • access: public
array getFilterValues ()
getStateParams (line 167)

Returns associative array with params that save the feature state

  • throws: miConfigurationException
  • access: public
array getStateParams ()

Redefinition of:
miTableFeature::getStateParams()
Returns associative array with params that save the feature state
getValues (line 144)

Get the feature values

  • throws: miConfigurationException
  • access: public
array getValues ()

Redefinition of:
miTableFeature::getValues()
Get the feature values
setConditionHandler (line 67)

Sets a condition handler The miView expects the handler class be subclassed from miSqlFilter

  • access: public
void setConditionHandler (string $condition, string $handlerClassName)
  • string $condition
  • string $handlerClassName
setDefaultFilterValues (line 77)

Set the default filter values

  • access: public
void setDefaultFilterValues (array $defaultFilterValues)
  • array $defaultFilterValues: an associative array with filter field and value

Inherited Methods

Inherited From miTableFeature

miTableFeature::__construct()
miTableFeature::getStateParams()
miTableFeature::getStateValue()
miTableFeature::getValues()
Class Constants
FILTER_CONDITION_SUFFIX = 'Condition' (line 17)
FILTER_NAME_SUFFIX = 'Filter' (line 16)

Documentation generated on Thu, 08 May 2008 16:57:45 +0300 by phpDocumentor 1.4.1