com.lokorin.lokorin.lib
[ class tree: com.lokorin.lokorin.lib ] [ index: com.lokorin.lokorin.lib ] [ all elements ]

Procedural File: lib_search.php

Source Location: /_includes/lib_search.php



Classes:

TableSearcher
Describes a utility that searches tables for rows that satisfy specified conditions. The result of a search can be retrieved directly as rows or as a sql statement describing the conditions.
SearchField
Describes a field that should be used in a search.
FulltextSearch
Describes a search field that implements fulltext searches.
LikeSearch
Describes a search field that implements LIKE searches.
EqualSearch
Describes a search field that searches for things that are equal to the parameter.
LesserSearch
Describes a search field that searches for things that are lesser than the parameter.
GreaterSearch
Describes a search field that searches for things that are greater than the parameter.
GreaterEqualSearch
Describes a search field that searches for things that are greater than or equal to the parameter.
LesserEqualSearch
Describes a search field that searches for things that are lesser than or equal to the parameter.
CustomSearch
Describes a search field that uses a custom pattern to construct the sql conditions.


Page Details:

A library that contains functions and classes related to searching databases.



Tags:

filesource:  Source Code for this file
license:  GNU Lesser General Public License
version:  $Revision: 1.7 $
author:  Andreas Launila


Includes:

require_once('common.php') [line 19]
For access to common constants and functions.







convertWildcardToLike [line 73]

string convertWildcardToLike( mixed $wildcardSearch, string $wildcardSeatch, public 1)

Converts a wildcard search where '*' means '0 or more characters' to the corresponding search in a LIKE search (using '%' instead of '*').



Tags:

return:  The corresponding LIKE search parameter.


Parameters

string   $wildcardSeatch   The search parameter that contains wildcards as '*'.
public   1  
[ Top ]



getTextSearchField [line 122]

SearchField getTextSearchField( string $requestName, string $tableField, [string $processCallback = ''], public 3)

Gets the appriopriate instance of a text search field (FulltextSearch or LikeSearch) to use with the specified constructor parameters. Fulltext is used if possible, otherwise LIKE is used.



Tags:

return:  The text search field that fits the parameters.


Parameters

string   $requestName   The name that identifies the field's value in the $_REQUEST array. It should be identical to names used in forms and so on.
string   $tableField   The name of the table field that should be associated with the search field.
string   $processCallback   An optional callback that will be used by the search field to process parameters before they are used in the sql query. The callback should take one value which is the value of the parameter from $_REQUEST and return one value, which is the desired value to use.
public   3  
[ Top ]



highlightWords [line 29]

string highlightWords( string $text, [array $words = array()], public 2)

Highlight specific words in a specified text.



Tags:

return:  The text with the specified words highlighted.


Parameters

string   $text   The text in which words should be highlighted.
array   $words   An array with the words that should be highlighted as values.
public   2  
[ Top ]



isFulltextSearchable [line 92]

True isFulltextSearchable( string $value, public 1)

Checks if a wildcard search can be done with fulltext or if LIKE has to be used (fulltext is faster).



Tags:

return:  if fulltext can be used, false otherwise.


Parameters

string   $value   The wildcard search value that is going to be used.
public   1  
[ Top ]



Documentation generated on Sun, 16 Apr 2006 21:03:52 +0200 by phpDocumentor 1.3.0RC4