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

Public Member Functions

 getParamDefinitions (array $definitions)
 
- Public Member Functions inherited from SMW\ResultPrinter
 __construct ($format, $inline=true, $useValidator=false)
 
 isEnabledFeature ($feature)
 
 getQueryMode ($context)
 
 getName ()
 
 setShowErrors ($show)
 
 getParameters ()
 
 getParamDefinitions (array $definitions)
 
 getNamedParameters (array $definitions=array())
 
 isExportFormat ()
 
 getDefaultSort ()
 
- Public Member Functions inherited from SMW\QueryResultPrinter
 getResult (QueryResult $results, array $fullParams, $outputMode)
 

Protected Member Functions

 getFormatOutput (array $data)
 
 addResources ()
 
 getResultText (SMWQueryResult $queryResult, $outputMode)
 
 applyDistributionParams (array &$data)
 
 getResults (SMWQueryResult $result, $outputMode)
 
 getDistributionResults (SMWQueryResult $result, $outputMode)
 
 getNumericResults (SMWQueryResult $res, $outputMode)
 
 addNumbersForDataItem (SMWDataItem $dataItem, array &$values, $name)
 
- Protected Member Functions inherited from SMW\ResultPrinter
 getResultText (SMWQueryResult $res, $outputMode)
 
 buildResult (SMWQueryResult $results)
 
 handleParameters (array $params, $outputMode)
 
 postProcessParameters ()
 
 getLinker ($firstcol=false)
 
 getFurtherResultsLink (SMWQueryResult $res, $outputMode)
 
 getErrorString (SMWQueryResult $res)
 
 escapeText ($text, $outputmode)
 
 getSearchLabel ($outputmode)
 
 linkFurtherResults (SMWQueryResult $results)
 
 addError ($errorMessage)
 
 textDisplayParameters ()
 
 exportFormatParameters ()
 

Additional Inherited Members

- Static Public Attributes inherited from SMW\ResultPrinter
static $maxRecursionDepth = 2
 
- Protected Attributes inherited from SMW\ResultPrinter
 $m_params
 
 $params
 
 $fullParams
 
 $outputMode
 
 $results
 
 $mIntro = ''
 
 $mOutro = ''
 
 $mSearchlabel = null
 
 $mDefault = ''
 
 $mFormat
 
 $mLinkFirst
 
 $mLinkOthers
 
 $mShowHeaders = SMW_HEADERS_SHOW
 
 $mShowErrors = true
 
 $mInline
 
 $mLinker
 
 $mErrors = array()
 
 $isHTML = false
 
 $hasTemplates = false
 

Detailed Description

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

Since
1.9

GNU GPL v2+

Author
Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com > 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

Member Function Documentation

SMW\AggregatablePrinter::addNumbersForDataItem ( SMWDataItem  $dataItem,
array &  $values,
  $name 
)
protected

Adds all numbers contained in a dataitem to the list.

Since
1.7
Parameters
SMWDataItem$dataItem
array$values
string$name
SMW\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
SMW\AggregatablePrinter::applyDistributionParams ( array &  $data)
protected

Apply the distribution specific parameters.

Since
1.7
Parameters
array$data
SMW\AggregatablePrinter::getDistributionResults ( SMWQueryResult  $result,
  $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
SMWQueryResult$result
$outputMode
Returns
array label => value
SMW\AggregatablePrinter::getFormatOutput ( array  $data)
abstractprotected

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

Since
1.7
Parameters
array$datalabel => value
SMW\AggregatablePrinter::getNumericResults ( SMWQueryResult  $res,
  $outputMode 
)
protected

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

Since
1.7
Parameters
SMWQueryResult$res
$outputMode
Returns
array label => value
SMW\AggregatablePrinter::getParamDefinitions ( array  $definitions)
See also
SMWResultPrinter::getParamDefinitions
Since
1.8
Parameters
ParamDefinition[]$definitions
Returns
array

Implements SMW\QueryResultPrinter.

SMW\AggregatablePrinter::getResults ( SMWQueryResult  $result,
  $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
SMWQueryResult$result
$outputMode
Returns
array label => value
SMW\AggregatablePrinter::getResultText ( SMWQueryResult  $queryResult,
  $outputMode 
)
protected

(non-PHPdoc)

See also
SMWResultPrinter::getResultText()

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