VuFind API Documentation

Query extends AbstractQuery
in package

A single/simple query.

Tags
category

VuFind

author

David Maus maus@hab.de

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link
https://vufind.org

Table of Contents

$operator  : string
Operator to apply to query string (null if not applicable)
$queryHandler  : string
Name of query handler, if any.
$queryString  : string
Query string
__construct()  : mixed
Constructor.
containsTerm()  : bool
Does the query contain the specified term? An optional normalizer can be provided to allow for fuzzier matching.
getAllTerms()  : string
Get a concatenated list of all query strings within the object.
getHandler()  : string
Return name of search handler.
getOperator()  : string
Return operator (null if n/a).
getString()  : string
Return search string (optionally applying a normalization callback)
replaceTerm()  : void
Replace a term.
setHandler()  : void
Set name of search handler.
setOperator()  : void
Set operator (null if n/a).
setString()  : void
Set the search string.

Properties

$operator

Operator to apply to query string (null if not applicable)

protected string $operator

$queryHandler

Name of query handler, if any.

protected string $queryHandler

$queryString

Query string

protected string $queryString

Methods

__construct()

Constructor.

public __construct([string $string = '' ][, string $handler = null ][, string $operator = null ]) : mixed
Parameters
$string : string = ''

Search string

$handler : string = null

Name of search handler

$operator : string = null

Operator to apply to query string (null if n/a)

Return values
mixed

containsTerm()

Does the query contain the specified term? An optional normalizer can be provided to allow for fuzzier matching.

public containsTerm(string $needle[, callable $normalizer = null ]) : bool
Parameters
$needle : string

Term to check

$normalizer : callable = null

Function to normalize text strings (null for no normalization)

Return values
bool

getAllTerms()

Get a concatenated list of all query strings within the object.

public getAllTerms() : string
Return values
string

getHandler()

Return name of search handler.

public getHandler() : string
Return values
string

getOperator()

Return operator (null if n/a).

public getOperator() : string
Return values
string

getString()

Return search string (optionally applying a normalization callback)

public getString([callable $normalizer = null ]) : string
Parameters
$normalizer : callable = null

Function to normalize text strings (null for no normalization)

Return values
string

replaceTerm()

Replace a term.

public replaceTerm(string $from, string $to[, callable $normalizer = null ]) : void
Parameters
$from : string

Search term to find

$to : string

Search term to insert

$normalizer : callable = null

Function to normalize text strings (null for no normalization)

Return values
void

setHandler()

Set name of search handler.

public setHandler(string $handler) : void
Parameters
$handler : string

Name of handler

Return values
void

setOperator()

Set operator (null if n/a).

public setOperator(string $operator) : void
Parameters
$operator : string

Operator

Return values
void

setString()

Set the search string.

public setString(string $string) : void
Parameters
$string : string

New search string

Return values
void

Search results