Semantic MediaWiki and related extensions
Static Public Member Functions | List of all members
SMW\SQLStore\RequestOptionsProc Class Reference

Static Public Member Functions

static getSQLOptions (RequestOptions $requestOptions=null, $valueCol='')
 
static getSQLConditions (Store $store, RequestOptions $requestOptions=null, $valueCol='', $labelCol='', $addAnd=true)
 
static applyRequestOptions (Store $store, array $data, RequestOptions $requestOptions=null)
 

Detailed Description

GNU GPL v2+

Since
2.3
Author
Markus Krötzsch
mwjames

Member Function Documentation

◆ applyRequestOptions()

static SMW\SQLStore\RequestOptionsProc::applyRequestOptions ( Store  $store,
array  $data,
RequestOptions  $requestOptions = null 
)
static

Not in all cases can requestoptions be forwarded to the DB using getSQLConditions() and getSQLOptions(): some data comes from caches that do not respect the options yet. This method takes an array of results (SMWDataItem objects) of the same type and applies the given requestoptions as appropriate.

Since
1.8
Parameters
Store$store
array$dataarray of SMWDataItem objects
SMWRequestOptions | null$requestoptions
Returns
SMWDataItem[]

◆ getSQLConditions()

static SMW\SQLStore\RequestOptionsProc::getSQLConditions ( Store  $store,
RequestOptions  $requestOptions = null,
  $valueCol = '',
  $labelCol = '',
  $addAnd = true 
)
static

Transform input parameters into a suitable string of additional SQL conditions. The parameter $valuecol defines the string name of the column to which value restrictions etc. are to be applied.

Since
1.8
Parameters
Store$store
RequestOptions | null$requestOptions
string$valueColname of SQL column to which conditions apply
string$labelColname of SQL column to which string conditions apply, if any
boolean$addAndindicate whether the string should begin with " AND " if non-empty
Returns
string

◆ getSQLOptions()

static SMW\SQLStore\RequestOptionsProc::getSQLOptions ( RequestOptions  $requestOptions = null,
  $valueCol = '' 
)
static

Transform input parameters into a suitable array of SQL options. The parameter $valuecol defines the string name of the column to which sorting requests etc. are to be applied.

Since
1.8
Parameters
RequestOptions | null$requestOptions
string$valueCol
Returns
array

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

About | General disclaimer | Privacy policy