Textpattern PHP Cross Reference Content Management Systems

Summary: /textpattern/vendors/Textpattern/Search/Method.php - 293 lines - 8091 bytes - Source - Print

Description: Admin-side search method.

Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Method:: (7 methods):
__construct()
setOptions()
getOptions()
setAlias()
findAlias()
getInfo()
getCriteria()

Class: Method


__construct($key, $atts line: 92
General constructor for search methods.

param: string $key  The unique reference to this Method
param: array  $atts Attributes such as the DB column(s) to which the method applies, its label or data type
setOptions($options = array()  line: 124
Sets method's options.

Valid options are:
-> always_like: treat the criteria as SQL LIKE, regardless if it is "in quotes".
-> can_list: the criteria can be a comma-separated list of values to retrieve.
-> case_sensitive: the criteria is case sensitive.

param: array $options Array of options
getOptions($keys = array()  line: 144
Gets methods options.

param: array $options Array of options
setAlias($column, $key, $aliases line: 167
Sets method aliases.

An alias' key is the literal value that is passed to the database as search criteria
if the user-supplied criteria matches any of the aliases. Useful for computed,
define()d or boolean fields. For example, allowing anyone to use the (localised)
words 'draft', 'hidden' or 'live' in a search box as aliases for the numeric
values 1, 2, and 4 respectively.

param: string $column  DB column to which the aliases should be applied.
param: string $key     DB value that is returned if the criteria matches.
param: array  $aliases Criteria values that are equivalent to the key.
findAlias($needle, $haystack, $type = '')  line: 186
Searches aliases for a partial match.

param: string $needle   The thing to look for
param: array  $haystack The place to look in
param: string $type     $needle's type, which affects the way the alias is interpreted
getInfo($item line: 211
Gets an item from the object.

param: string $item The thing to retrieve
getCriteria($search_term, $verbatim line: 236
Gets an SQL clause for this method based on the criteria.

param: string $search_term The value to search for
param: int    $verbatim    Whether the search term is in quotes (1) or not (0)

title

Body