CWIS Developer Documentation

- Home
- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

List of all members
SearchParameterSet Class Reference

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...

## Detailed Description

Set of parameters used to perform a search.

Definition at line 13 of file SearchParameterSet.php.

## Constructor & Destructor Documentation

SearchParameterSet::__construct | ( |  | $Data = `NULL` | ) |

Class constructor, used to create a new set or reload an existing set from previously-constructed data.

Parameters

  string | $Data | Existing search parameter set data, previously retrieved with SearchParameterSet::Data(). (OPTIONAL)

See also
  SearchParameterSet::Data()

Definition at line 25 of file SearchParameterSet.php.

## Member Function Documentation

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).

Parameters

  mixed | $SearchStrings | String or array of strings to search for.
  mixed | $Field | Field to search. (OPTIONAL – defaults to keyword search if no field specified)

See also
  SearchParameterSet::SetCanonicalFieldFunction()

Definition at line 92 of file SearchParameterSet.php.

SearchParameterSet::AddSet | ( | SearchParameterSet | $Set | ) |

Add subgroup of search parameters to set.

Parameters

  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.)

Parameters

  string | $NewValue | New search parameter set data. (OPTIONAL)

Returns
  string Current search parameter set data (opaque value).

Exceptions

  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.

Returns
  array Parameters in legacy array format.

See also
  SearchEngine::GroupedSearch()

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.

Parameters

  string | $NewValue | New setting, either "AND" or "OR". (OPTIONAL)

Returns
  string Current logic setting..

Exceptions

  InvalidArgumentException | if new setting is invalid.

Definition at line 127 of file SearchParameterSet.php.

Referenced by Data(), GetAsLegacyArray(), and TextDescription().

Here is the caller graph for this function:

static SearchParameterSet::SetCanonicalFieldFunction | ( |  | $Func | ) |
| 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.

Parameters

  callable | $Func | Function to call.

Exceptions

  InvalidArgumentException | if function supplied that is not callable.

Definition at line 42 of file SearchParameterSet.php.

static SearchParameterSet::SetPrintableFieldFunction | ( |  | $Func | ) |
| 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.

Parameters

  callable | $Func | Function to call.

Exceptions

  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().

Here is the caller graph for this function:

SearchParameterSet::UrlParameterString | ( |  | $NewValue = `NULL` | ) |

Definition at line 234 of file SearchParameterSet.php.

References UrlParameters().

## Member Data Documentation

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.

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

- lib/ScoutLib/SearchParameterSet.php