Stud.IP  4.0
 All Data Structures Namespaces Files Functions Variables Groups
Query Class Reference

Public Member Functions

 __construct (\User $user=null)
 
 getError ()
 
 getFilter ()
 
 getUser ()
 
 getOffset ()
 
 getPage ()
 
 getQuery ()
 
 getResultsPerPage ()
 
 getSort ()
 
 hasError ()
 
 setFilter (Filter $filter)
 
 setPage ($page)
 
 setQuery ($query)
 
 setResultsPerPage ($resultsPerPage)
 
 setSort ($sort)
 

Data Fields

const MIN_LENGTH = 4
 
const SORT_RELEVANCE = 'relevance'
 
const SORT_CHDATE = 'chdate'
 

Detailed Description

Simple class to hold everything about a files search query.

GPL2 or any later version

Since
Stud.IP 4.1

Constructor & Destructor Documentation

__construct ( \User  $user = null)

Creates an empty search query.

(PHPMD.Superglobals)

Member Function Documentation

getError ( )

Returns a possible error.

Returns
string if there is an error, returns a string, otherwise null
getFilter ( )

Returns the associated filter.

Returns
Filter the associated filter
getOffset ( )

Returns the offset of the first result using the current page and the setting of results per page.

Returns
int the offset of the first result
getPage ( )

Returns the current page.

Returns
int the current page
getQuery ( )

Returns the search query term.

Returns
string the search query term
getResultsPerPage ( )

Returns the current number of results per page.

Returns
int the current number of results per page
getSort ( )

Returns the sorting type.

Returns
string the sorting type
getUser ( )

Returns the user performing the search.

Returns
User the associated user
hasError ( )

Has the query an error?

Returns
bool either true, if there is an error; false otherwise
setFilter ( Filter  $filter)

Set the filter of this search query.

Parameters
Filter$filterthe filter to associate
Returns
Query returns $this for chaining
setPage (   $page)

Set the current page.

Parameters
int$pagethe current page
Returns
Query returns $this for chaining
setQuery (   $query)

Set the search query term.

Parameters
string$querythe search query term
Returns
Query returns $this for chaining
setResultsPerPage (   $resultsPerPage)

Set the number of results per page.

Parameters
int$resultsPerPagethe number of results per page
Returns
Query returns $this for chaining
setSort (   $sort)

Set the sort order.

Parameters
string$sorteither one of the two symbols Query::SORT_CHDATE or Query:SORT_RELEVANCE
Returns
Query returns $this for chaining

Field Documentation

const MIN_LENGTH = 4
const SORT_CHDATE = 'chdate'
const SORT_RELEVANCE = 'relevance'

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