Semantic MediaWiki and related extensions
Public Member Functions | Protected Member Functions | List of all members
SMW\Query\ResultPrinters\AggregatablePrinter Class Reference
Inheritance diagram for SMW\Query\ResultPrinters\AggregatablePrinter:
Inheritance graph
[legend]
Collaboration diagram for SMW\Query\ResultPrinters\AggregatablePrinter:
Collaboration graph
[legend]

Public Member Functions

 getParamDefinitions (array $definitions)
 
- Public Member Functions inherited from SMW\Query\ResultPrinters\ResultPrinter
 __construct ( $format, $inline=true)
 
 msg ()
 
 setRecursiveTextProcessor (RecursiveTextProcessor $recursiveTextProcessor)
 
 isEnabledFeature ( $feature)
 
 copyParser ()
 
 registerResources (array $modules=[], array $styleModules=[])
 
 getQueryMode ( $context)
 
 getName ()
 
 setShowErrors ( $show)
 
 getParameters ()
 
 getParamDefinitions (array $definitions)
 
 isExportFormat ()
 
 isDeferrable ()
 
 supportsRecursiveAnnotation ()
 
 getDefaultSort ()
 
- Public Member Functions inherited from SMW\Query\ResultPrinter
 getResult (QueryResult $results, array $fullParams, $outputMode)
 

Protected Member Functions

 getFormatOutput (array $data)
 
 addResources ()
 
 getResultText (QueryResult $queryResult, $outputMode)
 
 applyDistributionParams (array &$data)
 
 getResults (QueryResult $queryResult, $outputMode)
 
 getDistributionResults (QueryResult $queryResult, $outputMode)
 
 getNumericResults (QueryResult $queryResult, $outputMode)
 
 addNumbersForDataItem (DataItem $dataItem, array &$values, $name)
 
- Protected Member Functions inherited from SMW\Query\ResultPrinters\ResultPrinter
 getResultText (QueryResult $res, $outputMode)
 
 buildResult (QueryResult $results)
 
 handleNonFileResult ( $result, QueryResult $results, $outputmode)
 
 handleParameters (array $params, $outputMode)
 
 postProcessParameters ()
 
 getLinker ( $firstcol=false)
 
 getLink (QueryResult $res, $outputMode, $classAffix='')
 
 getFurtherResultsLink (QueryResult $res, $outputMode)
 
 getErrorString (QueryResult $res)
 
 getResources ()
 
 escapeText ( $text, $outputmode)
 
 getSearchLabel ( $outputmode)
 
 linkFurtherResults (QueryResult $results)
 
 addError ( $errorMessage)
 

Additional Inherited Members

- Public Attributes inherited from SMW\Query\ResultPrinters\ResultPrinter
const DEFERRED_DATA = 'deferred.data'
 
- Static Public Attributes inherited from SMW\Query\ResultPrinters\ResultPrinter
static $maxRecursionDepth = 2
 
- Protected Attributes inherited from SMW\Query\ResultPrinters\ResultPrinter
 $params
 
 $fullParams
 
 $outputMode
 
 $results
 
 $mIntro = ''
 
 $mOutro = ''
 
 $mSearchlabel = null
 
 $mDefault = ''
 
 $mFormat
 
 $mLinkFirst
 
 $mLinkOthers
 
 $mShowHeaders = SMW_HEADERS_SHOW
 
 $mShowErrors = true
 
 $mInline
 
 $mLinker
 
 $mErrors = []
 
 $isHTML = false
 
 $hasTemplates = false
 
 $recursiveTextProcessor
 
 $transcludeAnnotation = true
 

Detailed Description

Abstract class that supports the aggregation and distributive calculation of numerical data.

Abstract class that supports the aggregation and distributive calculation of numerical data. Supports the distribution parameter, and related parameters that allows the user to choose between regular behavior or generating a distribution of values.

For example, this result set: foo bar baz foo bar bar ohi Will be turned into

GNU GPL v2+

Since
1.9
Author
Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >

Member Function Documentation

◆ addNumbersForDataItem()

SMW\Query\ResultPrinters\AggregatablePrinter::addNumbersForDataItem ( DataItem  $dataItem,
array &  $values,
  $name 
)
protected

Adds all numbers contained in a dataitem to the list.

Since
1.7
Parameters
DataItem$dataItem
array$values
string$name

◆ addResources()

SMW\Query\ResultPrinters\AggregatablePrinter::addResources ( )
protected

Method gets called right before the result is returned in case there are values to display. It is meant for adding resources such as JS and CSS only needed for this format when it has actual values.

Since
1.7

◆ applyDistributionParams()

SMW\Query\ResultPrinters\AggregatablePrinter::applyDistributionParams ( array &  $data)
protected

Apply the distribution specific parameters.

Since
1.7
Parameters
array$data

◆ getDistributionResults()

SMW\Query\ResultPrinters\AggregatablePrinter::getDistributionResults ( QueryResult  $queryResult,
  $outputMode 
)
protected

Counts all the occurrences of all values in the query result, and returns an array with as key the value and as value the count.

Since
1.7
Parameters
QueryResult$queryResult
$outputMode
Returns
array label => value

◆ getFormatOutput()

SMW\Query\ResultPrinters\AggregatablePrinter::getFormatOutput ( array  $data)
abstractprotected

Create the formats output given the result data and return it.

Since
1.7
Parameters
array$datalabel => value

◆ getNumericResults()

SMW\Query\ResultPrinters\AggregatablePrinter::getNumericResults ( QueryResult  $queryResult,
  $outputMode 
)
protected

Returns an array with the numerical data in the query result.

Since
1.7
Parameters
QueryResult$queryResult
$outputMode
Returns
array label => value

◆ getParamDefinitions()

SMW\Query\ResultPrinters\AggregatablePrinter::getParamDefinitions ( array  $definitions)
See also
ResultPrinter::getParamDefinitions
Since
1.8

Takes a list of parameter definitions and adds those supported by this result printer. Most result printers should override this method.

Since
1.8
Parameters
ParamDefinition[]$definitions
Returns
array

Implements SMW\Query\ResultPrinter.

◆ getResults()

SMW\Query\ResultPrinters\AggregatablePrinter::getResults ( QueryResult  $queryResult,
  $outputMode 
)
protected

Gets and processes the results so they can be fed directly to the getFormatOutput method. They are returned as an array with the keys being the labels and the values being their corresponding (numeric) values.

Since
1.7
Parameters
QueryResult$queryResult
$outputMode
Returns
array label => value

◆ getResultText()

SMW\Query\ResultPrinters\AggregatablePrinter::getResultText ( QueryResult  $queryResult,
  $outputMode 
)
protected

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

About | General disclaimer | Privacy policy