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

Public Member Functions

 __construct (SQLStore $store)
 
 getSQLOptionsFrom (RequestOptions $requestOptions=null, $valueCol= '')
 
 getSQLConditionsFrom (RequestOptions $requestOptions=null, $valueCol= '', $labelCol= '', $addAnd=true)
 
 applyRequestOptionsTo (array $data, RequestOptions $requestOptions=null)
 

Detailed Description

GNU GPL v2+

Since
2.3
Author
Markus Krötzsch
mwjames

Constructor & Destructor Documentation

SMW\SQLStore\RequestOptionsProcessor::__construct ( SQLStore  $store)
Since
2.3
Parameters
SQLStore$store

Member Function Documentation

SMW\SQLStore\RequestOptionsProcessor::applyRequestOptionsTo ( array  $data,
RequestOptions  $requestOptions = null 
)

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
array$dataarray of SMWDataItem objects
SMWRequestOptions | null$requestoptions
Returns
SMWDataItem[]
SMW\SQLStore\RequestOptionsProcessor::getSQLConditionsFrom ( RequestOptions  $requestOptions = null,
  $valueCol = '',
  $labelCol = '',
  $addAnd = true 
)

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
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
SMW\SQLStore\RequestOptionsProcessor::getSQLOptionsFrom ( RequestOptions  $requestOptions = null,
  $valueCol = '' 
)

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: