CWIS Developer Documentation
|
Set of parameters used to perform a search. More...
Public Member Functions | |
Set Construction | |
Get/set URL parameter prefix. | |
AddParameter ($SearchStrings, $Field=NULL) | |
Add search parameter to set. More... | |
Logic ($NewValue=NULL) | |
Get/set logic for set. More... | |
AddSet (SearchParameterSet $Set) | |
Add subgroup of search parameters to set. More... | |
Data Translation | |
Data ($NewValue=NULL) | |
Get/set search parameter set data, in the form of an opaque string. More... | |
UrlParameters ($NewValue=NULL) | |
UrlParameterString ($NewValue=NULL) | |
TextDescription ($IncludeHtml=TRUE, $StartWithBreak=TRUE, $TruncateLongWordsTo=0, $Indent="") | |
Setup / Configuration | |
__construct ($Data=NULL) | |
Class constructor, used to create a new set or reload an existing set from previously-constructed data. More... | |
static | SetCanonicalFieldFunction ($Func) |
Register function used to retrieve a canonical value for a field. More... | |
static | SetPrintableFieldFunction ($Func) |
Register function used to retrieve a printable value for a field. More... | |
Backward Compatibility | |
const | DEFAULT_LOGIC = "AND" |
const | URL_KEYWORDFREE_RANGE = "A-JL-Z" |
const | URL_KEYWORD_INDICATOR = "K" |
const | URL_LOGIC_INDICATOR = "00" |
GetAsLegacyArray () | |
Retrieve search parameters in legacy array format. More... | |
Set of parameters used to perform a search.
Definition at line 13 of file SearchParameterSet.php.
SearchParameterSet::__construct | ( | $Data = NULL | ) |
Class constructor, used to create a new set or reload an existing set from previously-constructed data.
string | $Data | Existing search parameter set data, previously retrieved with SearchParameterSet::Data(). (OPTIONAL) |
Definition at line 25 of file SearchParameterSet.php.
SearchParameterSet::AddParameter | ( | $SearchStrings, | |
$Field = NULL |
|||
) |
Add search parameter to set.
If a canonical field function is set, the field to search can be anything accepted by that function, otherwise the $Field argument must be a type usable as an array index (e.g. an integer or a string).
mixed | $SearchStrings | String or array of strings to search for. |
mixed | $Field | Field to search. (OPTIONAL – defaults to keyword search if no field specified) |
Definition at line 92 of file SearchParameterSet.php.
SearchParameterSet::AddSet | ( | SearchParameterSet | $Set | ) |
Add subgroup of search parameters to set.
SearchParameterSet | $Set | Subgroup to add. |
Definition at line 154 of file SearchParameterSet.php.
SearchParameterSet::Data | ( | $NewValue = NULL | ) |
Get/set search parameter set data, in the form of an opaque string.
This method can be used to retrieve an opaque string containing set data, which can then be saved (e.g. to a database) and later used to reload a search parameter set. (Use instead of serialize() to avoid future issues with internal class changes.)
string | $NewValue | New search parameter set data. (OPTIONAL) |
InvalidArgumentException | if incoming set data appears invalid. |
Definition at line 175 of file SearchParameterSet.php.
References Logic().
SearchParameterSet::GetAsLegacyArray | ( | ) |
Retrieve search parameters in legacy array format.
This method is provided for backward compatibility only, and its use is deprecated. Searches conducted using the legacy format may not return identical results because the legacy format does not support nested search groups.
Definition at line 389 of file SearchParameterSet.php.
References Logic(), SearchEngine\LOGIC_AND, and SearchEngine\LOGIC_OR.
SearchParameterSet::Logic | ( | $NewValue = NULL | ) |
Get/set logic for set.
string | $NewValue | New setting, either "AND" or "OR". (OPTIONAL) |
InvalidArgumentException | if new setting is invalid. |
Definition at line 127 of file SearchParameterSet.php.
Referenced by Data(), GetAsLegacyArray(), and TextDescription().
|
static |
Register function used to retrieve a canonical value for a field.
This This function should accept a single mixed parameter and return a canonical integer value for the field.
callable | $Func | Function to call. |
InvalidArgumentException | if function supplied that is not callable. |
Definition at line 42 of file SearchParameterSet.php.
|
static |
Register function used to retrieve a printable value for a field.
This function should accept a single mixed parameter and return a human-readable name for the field.
callable | $Func | Function to call. |
InvalidArgumentException | if function supplied that is not callable. |
Definition at line 61 of file SearchParameterSet.php.
SearchParameterSet::TextDescription | ( | $IncludeHtml = TRUE , |
|
$StartWithBreak = TRUE , |
|||
$TruncateLongWordsTo = 0 , |
|||
$Indent = "" |
|||
) |
Definition at line 263 of file SearchParameterSet.php.
References Logic().
SearchParameterSet::UrlParameters | ( | $NewValue = NULL | ) |
Definition at line 209 of file SearchParameterSet.php.
Referenced by UrlParameterString().
SearchParameterSet::UrlParameterString | ( | $NewValue = NULL | ) |
Definition at line 234 of file SearchParameterSet.php.
References UrlParameters().
const SearchParameterSet::DEFAULT_LOGIC = "AND" |
Definition at line 445 of file SearchParameterSet.php.
const SearchParameterSet::URL_KEYWORD_INDICATOR = "K" |
Definition at line 447 of file SearchParameterSet.php.
const SearchParameterSet::URL_KEYWORDFREE_RANGE = "A-JL-Z" |
Definition at line 446 of file SearchParameterSet.php.
const SearchParameterSet::URL_LOGIC_INDICATOR = "00" |
Definition at line 448 of file SearchParameterSet.php.