Semantic MediaWiki and related extensions
Public Member Functions | Public Attributes | List of all members
SMW\RequestOptions Class Reference

Public Member Functions

 setCaller ( $caller)
 
 getCaller ()
 
 addStringCondition ( $string, $condition, $isOr=false, $isNot=false)
 
 getStringConditions ()
 
 addExtraCondition ( $extraCondition)
 
 getExtraConditions ()
 
 emptyExtraConditions ()
 
 setOption ( $key, $value)
 
 deleteOption ( $key)
 
 getOption ( $key, $default=null)
 
 setLimit ( $limit)
 
 getLimit ()
 
 setOffset ( $offset)
 
 getOffset ()
 
 setLookahead (int $lookahead)
 
 getLookahead ()
 
 getHash ()
 

Public Attributes

const CONDITION_CONSTRAINT_RESULT = 'condition.constraint.result'
 
const CONDITION_CONSTRAINT = 'conditon.constraint'
 
const PREFETCH_FINGERPRINT = 'prefetch.fingerprint'
 
const SEARCH_FIELD = 'search_field'
 
 $limit = -1
 
 $exclude_limit = false
 
 $offset = 0
 
 $lookahead = 0
 
 $sort = false
 
 $ascending = true
 
 $boundary = null
 
 $include_boundary = true
 

Detailed Description

Container object for various options that can be used when retrieving data from the store. These options are mostly relevant for simple, direct requests – inline queries may require more complex options due to their more complex structure. Options that should not be used or where default values should be used can be left as initialised.

GNU GPL v2+

Since
1.0
Author
Markus Krötzsch

Member Function Documentation

◆ addExtraCondition()

SMW\RequestOptions::addExtraCondition (   $extraCondition)
Since
2.5
Parameters
mixed$extraCondition

◆ addStringCondition()

SMW\RequestOptions::addStringCondition (   $string,
  $condition,
  $isOr = false,
  $isNot = false 
)
Since
1.0
Parameters
string$stringto match
integer$conditionone of STRCOND_PRE, STRCOND_POST, STRCOND_MID
boolean$isOr
boolean$isNot

◆ deleteOption()

SMW\RequestOptions::deleteOption (   $key)
Since
3.1
Parameters
string$key
string$value

◆ emptyExtraConditions()

SMW\RequestOptions::emptyExtraConditions ( )
Since
3.1

◆ getCaller()

SMW\RequestOptions::getCaller ( )
Since
3.1
Returns
string

◆ getExtraConditions()

SMW\RequestOptions::getExtraConditions ( )
Since
2.5
Parameters
array

◆ getHash()

SMW\RequestOptions::getHash ( )
Since
2.4
Returns
string

◆ getLimit()

SMW\RequestOptions::getLimit ( )
Since
2.5
Returns
integer

◆ getLookahead()

SMW\RequestOptions::getLookahead ( )
Since
3.2
Returns
integer

◆ getOffset()

SMW\RequestOptions::getOffset ( )
Since
2.5
Returns
integer

◆ getOption()

SMW\RequestOptions::getOption (   $key,
  $default = null 
)
Since
3.0
Parameters
string$key
mixed$default
Returns
mixed

◆ getStringConditions()

SMW\RequestOptions::getStringConditions ( )

Return the specified array of SMWStringCondition objects.

Since
1.0
Returns
array

◆ setCaller()

SMW\RequestOptions::setCaller (   $caller)
Since
3.1
Parameters
string$caller

◆ setLimit()

SMW\RequestOptions::setLimit (   $limit)
Since
2.5
Parameters
integer$limit

◆ setLookahead()

SMW\RequestOptions::setLookahead ( int  $lookahead)
Since
3.2
Parameters
integer$lookahead

◆ setOffset()

SMW\RequestOptions::setOffset (   $offset)
Since
2.5
Parameters
integer$offset

◆ setOption()

SMW\RequestOptions::setOption (   $key,
  $value 
)
Since
3.0
Parameters
string$key
string$value

Member Data Documentation

◆ $ascending

SMW\RequestOptions::$ascending = true

If SMWRequestOptions->$sort is true, this parameter defines whether the results are ordered in ascending or descending order.

◆ $boundary

SMW\RequestOptions::$boundary = null

Specifies a lower or upper bound for the values returned by the query. Whether it is lower or upper is specified by the parameter "ascending" (true->lower, false->upper).

◆ $exclude_limit

SMW\RequestOptions::$exclude_limit = false

For certain queries (prefetch using WHERE IN) using the limit will cause the whole set to be restricted on a bulk instead of only applied to a subset therefore allow the exclude the limit and apply an restriction during the post-processing.

◆ $include_boundary

SMW\RequestOptions::$include_boundary = true

Specifies whether or not the requested boundary should be returned as a result.

◆ $limit

SMW\RequestOptions::$limit = -1

The maximum number of results that should be returned.

◆ $lookahead

SMW\RequestOptions::$lookahead = 0

A numerical size to indicate a "look ahead" beyond the defined limit.

◆ $offset

SMW\RequestOptions::$offset = 0

A numerical offset. The first $offset results are skipped. Note that this does not imply a defined order of results (see SMWRequestOptions->$sort below).

◆ $sort

SMW\RequestOptions::$sort = false

Should the result be ordered? The employed order is defined by the type of result that are requested: wiki pages and strings are ordered alphabetically, whereas other data is ordered numerically. Usually, the order should be fairly "natural".

◆ CONDITION_CONSTRAINT

const SMW\RequestOptions::CONDITION_CONSTRAINT = 'conditon.constraint'

Used to identify a constraint conidtion set forth by any other query process.

◆ CONDITION_CONSTRAINT_RESULT

const SMW\RequestOptions::CONDITION_CONSTRAINT_RESULT = 'condition.constraint.result'

Used to identify a constraint conition set forth by the QueryResult process which doesn't modify the limit.

◆ PREFETCH_FINGERPRINT

const SMW\RequestOptions::PREFETCH_FINGERPRINT = 'prefetch.fingerprint'

Defines a prefetch fingerprint

◆ SEARCH_FIELD

const SMW\RequestOptions::SEARCH_FIELD = 'search_field'

Defines an individual search field


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

About | General disclaimer | Privacy policy