.

DBFilter Class Reference
[Model]

A filter to apply to a search result. More...

Inheritance diagram for DBFilter:
IDBQueryModifier DBFilterColumn

List of all members.

Public Member Functions

  __construct ($title, $key= '')
  contructor
  apply ($query)
  Do what should be done.
  get_key ()
  get_title ()
  is_default ()
  set_is_default ($bool)
  set_key ($key)
  set_title ($title)

Protected Member Functions

  preprocess_value ($value, $operator)
  Preporocess value depending on operator.

Detailed Description

A filter to apply to a search result.

Author:
Gerd Riesselmann

Definition at line 8 of file dbfilter.cls.php.


Constructor & Destructor Documentation

DBFilter::__construct ( title,
key = ''  
)

contructor

Parameters:
string  title
string  key

Definition at line 27 of file dbfilter.cls.php.

00027                                                        {
00028                 $this->title = $title;
00029                 $this->key = ($key) ? $key : $title;
00030         }

Member Function Documentation

DBFilter::apply ( query  ) 

Do what should be done.

Parameters:
DataObjectBase  The current query to be modified

Implements IDBQueryModifier.

Reimplemented in DBFilterColumn.

Definition at line 48 of file dbfilter.cls.php.

00048                                       {
00049                 // Do nothng here
00050         }
DBFilter::get_key (  ) 

Definition at line 40 of file dbfilter.cls.php.

00040                                   {
00041                 return $this->key;
00042         }
DBFilter::get_title (  ) 

Definition at line 32 of file dbfilter.cls.php.

00032                                     {
00033                 return $this->title;
00034         }
DBFilter::is_default (  ) 

Definition at line 52 of file dbfilter.cls.php.

00052                                      {
00053                 return $this->is_default;               
00054         }
DBFilter::preprocess_value ( value,
operator  
) [protected]

Preporocess value depending on operator.

Since:
0.5.1
Parameters:
string  $value
string  $operator
Returns:
string

Definition at line 69 of file dbfilter.cls.php.

00069                                                                {
00070                 $ret = $value;
00071                 switch ($operator) {
00072                         case DBWhere::OP_LIKE:
00073                                 if ($value !== '') {
00074                                         $ret = '%' . $value . '%';
00075                                 }
00076                                 break;
00077                 }
00078                 return $ret;
00079         }
DBFilter::set_is_default ( bool  ) 

Definition at line 56 of file dbfilter.cls.php.

00056                                               {
00057                 $this->is_default = $bool;
00058         }
DBFilter::set_key ( key  ) 

Definition at line 44 of file dbfilter.cls.php.

00044                                       {
00045                 $this->key = $key;
00046         }
DBFilter::set_title ( title  ) 

Definition at line 36 of file dbfilter.cls.php.

00036                                           {
00037                 $this->title = $title;
00038         }

The documentation for this class was generated from the following file: