Framework  3.9
SearchParameterHandler Class Reference

Base class for SearchParameterHandlers. More...

+ Inheritance diagram for SearchParameterHandler:

Public Member Functions

 equal ($name, $value)
 Generates the constraint expression for equality matching parameters. More...
 
 like ($name, $value)
 Generates the constraint expression for 'like' matching parameters, i.e. More...
 
 startsWith ($name, $value)
 Generates the constraint expression for 'startsWith' matching parameters, i.e. More...
 
 from ($name, $from)
 Generates the constraint expression for 'from' matching parameters, i.e. More...
 
 to ($name, $to)
 Generates the constraint expression for 'to' matching parameters, i.e. More...
 
 range ($name, $from, $to)
 Generates the constraint expression for 'range' matching parameters, i.e. More...
 
 member ($name, $set)
 Generate the constraint expression for set membership matching paramters, matching values in a comma delimite set. More...
 
 any ($name, $value)
 Generate the constraint expression for matching any word in a group of words. More...
 
 all ($name, $value)
 Generate the constraint expression for matching all words in a group of words but allowing other words in between. More...
 
 fullName ($f_name, $l_name, $value)
 Generate the constraint expression for matching the f_name and l_name fields to a given value. More...
 
 checked ($name, $value)
 Generate the constraint expresssion for matching boolean only when the UI element is selected. More...
 

Detailed Description

Base class for SearchParameterHandlers.

Each derived SearchParameterHandler should extend this base class and implement the type-dependent behaviors appropriate for the type being handled.

SearchParameterHandlers are responsible for generating the query constraint expressions that provide appropriate matching for the search parameters being used to build a query from information entered into a SearchForm.

Author
andy

Definition at line 50 of file search_form.inc.

Member Function Documentation

◆ all()

SearchParameterHandler::all (   $name,
  $value 
)

Generate the constraint expression for matching all words in a group of words but allowing other words in between.

Parameters
string$namethe name of the field
string$valuea string that may contain multiple words
Returns
string a SQL expression to peform the match

Reimplemented in StringSearchParameterHandler.

Definition at line 156 of file search_form.inc.

157  {
158  }

◆ any()

SearchParameterHandler::any (   $name,
  $value 
)

Generate the constraint expression for matching any word in a group of words.

Parameters
string$namethe name of the field
string$valuea string that may contain multiple words
Returns
string a SQL expression to peform the match

Reimplemented in StringSearchParameterHandler, and NumberSearchParameterHandler.

Definition at line 143 of file search_form.inc.

144  {
145  }

◆ checked()

SearchParameterHandler::checked (   $name,
  $value 
)

Generate the constraint expresssion for matching boolean only when the UI element is selected.

Parameters
string$name
mixed$value

Reimplemented in BooleanSearchParameterHandler.

Definition at line 180 of file search_form.inc.

181  {
182  }

◆ equal()

SearchParameterHandler::equal (   $name,
  $value 
)

Generates the constraint expression for equality matching parameters.

Parameters
string$namethe name of the field
mixed$valuethe value to match
Returns
string a SQL expression to perform the match

Reimplemented in BooleanSearchParameterHandler, DateSearchParameterHandler, StringSearchParameterHandler, and NumberSearchParameterHandler.

Definition at line 58 of file search_form.inc.

59  {
60  }

◆ from()

SearchParameterHandler::from (   $name,
  $from 
)

Generates the constraint expression for 'from' matching parameters, i.e.

matching values that are greater than or equal to the specified value.

Parameters
string$namethe name of the field
mixed$fromthe lower bound
Returns
string a SQL expression to perform the match

Reimplemented in DateSearchParameterHandler, StringSearchParameterHandler, and NumberSearchParameterHandler.

Definition at line 92 of file search_form.inc.

93  {
94 
95  }

◆ fullName()

SearchParameterHandler::fullName (   $f_name,
  $l_name,
  $value 
)

Generate the constraint expression for matching the f_name and l_name fields to a given value.

Parameters
string$f_namethe name of the first name field
string$l_namethe name of the last name field
string$valuea string that may contain multiple words
Returns
string a SQL expression to perform the match

Reimplemented in StringSearchParameterHandler.

Definition at line 169 of file search_form.inc.

170  {
171 
172  }

◆ like()

SearchParameterHandler::like (   $name,
  $value 
)

Generates the constraint expression for 'like' matching parameters, i.e.

matching a substring or partial match.

Parameters
string$namethe name of the field
mixed$valuethe value to match
Returns
string a SQL expression to perform the match

Reimplemented in DateSearchParameterHandler, StringSearchParameterHandler, and NumberSearchParameterHandler.

Definition at line 69 of file search_form.inc.

70  {
71  }

◆ member()

SearchParameterHandler::member (   $name,
  $set 
)

Generate the constraint expression for set membership matching paramters, matching values in a comma delimite set.

Parameters
string$namethe name of the field
string$seta comma delimited set of values to match
Returns
string a SQL expression to peform the match

Reimplemented in CrossReferenceSearchParameterHandler, StringSearchParameterHandler, and NumberSearchParameterHandler.

Definition at line 130 of file search_form.inc.

131  {
132  }

◆ range()

SearchParameterHandler::range (   $name,
  $from,
  $to 
)

Generates the constraint expression for 'range' matching parameters, i.e.

matching values that within the range of the two specified values.

Parameters
string$namethe name of the field
string$fromthe lower bound
mixed$tothe value to match
Returns
string a SQL expression to perform the match

Reimplemented in DateSearchParameterHandler, StringSearchParameterHandler, and NumberSearchParameterHandler.

Definition at line 117 of file search_form.inc.

118  {
119  }

◆ startsWith()

SearchParameterHandler::startsWith (   $name,
  $value 
)

Generates the constraint expression for 'startsWith' matching parameters, i.e.

matching a substring or partial match at the start of the field only.

Parameters
string$namethe name of the field
string$valuethe value to match
Returns
string a SQL expression to perform the match

Reimplemented in DateSearchParameterHandler, StringSearchParameterHandler, and NumberSearchParameterHandler.

Definition at line 80 of file search_form.inc.

81  {
82 
83  }

◆ to()

SearchParameterHandler::to (   $name,
  $to 
)

Generates the constraint expression for 'to' matching parameters, i.e.

matching values that are less than or equal to the specified value.

Parameters
string$namethe name of the field
mixed$tothe upper bound
Returns
string a SQL expression to perform the match

Reimplemented in DateSearchParameterHandler, StringSearchParameterHandler, and NumberSearchParameterHandler.

Definition at line 104 of file search_form.inc.

105  {
106 
107  }

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