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

Public Member Functions

 __construct (SMWQueryResult $queryResult)
 
 setIsRawMode ( $isRawMode)
 
 getContinueOffset ()
 
 getType ()
 
 getResult ()
 
 doFormat ()
 
 setIndexedTagName (&$arr, $tag=null)
 

Protected Member Functions

 formatResults (array $queryResult)
 
 formatErrors (array $errors)
 

Protected Attributes

 $continueOffset = false
 
 $type
 
 $isRawMode = false
 

Detailed Description

This class handles the Api related query result formatting

GNU GPL v2+

Since
1.9
Author
mwjames

Constructor & Destructor Documentation

◆ __construct()

SMW\MediaWiki\Api\ApiQueryResultFormatter::__construct ( SMWQueryResult  $queryResult)
Since
1.9
Parameters
SMWQueryResult$queryResult

Member Function Documentation

◆ doFormat()

SMW\MediaWiki\Api\ApiQueryResultFormatter::doFormat ( )

Result formatting

Since
1.9

◆ formatErrors()

SMW\MediaWiki\Api\ApiQueryResultFormatter::formatErrors ( array  $errors)
protected

Formatting an error array in order to support JSON/XML

Since
1.9
Parameters
array$errors
Returns
array

◆ formatResults()

SMW\MediaWiki\Api\ApiQueryResultFormatter::formatResults ( array  $queryResult)
protected

Formatting a result array to support JSON/XML standards

Since
1.9
Parameters
array$queryResult
Returns
array

◆ getContinueOffset()

SMW\MediaWiki\Api\ApiQueryResultFormatter::getContinueOffset ( )

Returns an offset used for continuation support

Since
1.9
Returns
integer

◆ getResult()

SMW\MediaWiki\Api\ApiQueryResultFormatter::getResult ( )

Returns formatted result

Since
1.9
Returns
array

◆ getType()

SMW\MediaWiki\Api\ApiQueryResultFormatter::getType ( )

Returns the result type

Since
1.9
Returns
string

◆ setIndexedTagName()

SMW\MediaWiki\Api\ApiQueryResultFormatter::setIndexedTagName ( $arr,
  $tag = null 
)

Add '_element' to an array

Note
Copied from ApiResult::setIndexedTagName to avoid having a constructor injection in order to be able to access this method
See also
ApiResult::setIndexedTagName
Since
1.9
Parameters
array&$arr
string$tag

◆ setIsRawMode()

SMW\MediaWiki\Api\ApiQueryResultFormatter::setIsRawMode (   $isRawMode)

Sets whether the formatter requested raw data and is used in connection with ApiQueryResultFormatter::setIndexedTagName

See also
ApiResult::getIsRawMode
Since
1.9
Parameters
boolean$isRawMode

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

About | General disclaimer | Privacy policy