MDB2_TableBrowser
[ class tree: MDB2_TableBrowser ] [ index: MDB2_TableBrowser ] [ all elements ]

Class: MDB2_TableBrowser_FilterManager

Source Location: /MDB2_TableBrowser-0.1.3/MDB2/TableBrowser/FilterManager.php

Class Overview


This class implements the whereClauseGenerator interface


Author(s):

Version:

  • Release: <package_version>

Copyright:

  • 2007-2012 Isaac Tewolde

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 38]
This class implements the whereClauseGenerator interface

It is used by other classes to create and manage the where clause of an SQL statement. As such, it's primary purpose is to add/remove filters which are expressions that evaluate to true or false.

These filters together form a filter-chain. A row is described as matching if each filter in the chain is evaluated as true.



[ Top ]


Class Variables

$filters = array()

[line 41]

  • Access: protected

Type:   mixed


[ Top ]

$validator =  null

[line 40]

  • Access: protected

Type:   mixed


[ Top ]



Method Detail

__construct (Constructor)   [line 48]

MDB2_TableBrowser_FilterManager __construct( MDB2_TableBrowser_InterfaceTableValidator &$validator)

Constructor
  • Access: public

Parameters:

tableValidator   &$validator     A refrence to an object that implements the tableValidator interface

[ Top ]

addCustomFilter   [line 125]

void addCustomFilter( string $filterName, string $sqlFrangment)

Adds a custom filter. A custom filter is an sql fragment that is added to the where clause of an sql statement. Like any other filter it must evaluate to true/false
  • Access: public

Parameters:

string   $filterName     The filter name
string   $sqlFrangment     The sql fragment

[ Top ]

addFilter   [line 69]

void addFilter( string $filterName, string $columnName, string $operator, mixed $value)

Adds a filter to the filter chain

A filter is an expression of the form columnName = "some value'. It can also be multivalued eg: (columnName = "value1" OR columnName="value2")

  • Access: public

Parameters:

string   $filterName     The filter name
string   $columnName     The column name
string   $operator     The operator eg: '=', '<>', '>=', etc.
mixed   $value     If string, then a single filter is being added eg: "animal = 'cat'" If array, then a multivalue filter is being added eg: "animal is one of 'cat','dog', or 'fish'"

[ Top ]

createSQLFilter   [line 91]

string createSQLFilter( string $columnName, string $operator, string $value)

Creates the actual sql fragment that forms the filter
  • Access: protected

Parameters:

string   $columnName     The column name
string   $operator     The operator
string   $value     The column value

[ Top ]

generateSQL   [line 135]

string generateSQL( )

Converts the current filter chain into a string containing the where clause
  • Access: public

[ Top ]

removeFilter   [line 111]

void removeFilter( string $filterName)

Removes a filter from the filter chain
  • Access: public

Parameters:

string   $filterName     The filter name

[ Top ]

resetFilters   [line 100]

void resetFilters( )

Clears the current filter chain
  • Access: public

[ Top ]

validateExpression   [line 154]

void validateExpression( string $columnName, string $operator, string $value)

Checks to see if the parameters will form a proper filter expression. It uses the tableValidator object to do this.
  • Throws: MDB2_TableBrowser_ParameterException if one of the parameters is invalid
  • Access: public

Parameters:

string   $columnName     The name of table column
string   $operator     The operator
string   $value     The value

[ Top ]


Documentation generated on Fri, 13 Apr 2012 03:00:04 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.