PHP Class Piwik\API\DataTableManipulator\Flattener

It loads subtables and combines them into a single table by concatenating the labels. This manipulator is triggered by using flat=1 in the API request.
Inheritance: extends Piwik\API\DataTableManipulator
Show file Open project: piwik/piwik Class Usage Examples

Public Properties

Property Type Description
$recursiveLabelSeparator string Separator for building recursive labels (or paths)

Public Methods

Method Description
flatten ( DataTable $dataTable, string $recursiveLabelSeparator ) : DataTable | Piwik\DataTable\Map
includeAggregateRows ( ) If the flattener is used after calling this method, aggregate rows will be included in the result. This can be useful when they contain data that the leafs don't have (e.g. conversion stats in some cases).

Protected Methods

Method Description
flattenDataTableInto ( $dataTable, $newDataTable, $prefix = '', $logo = false )
manipulateDataTable ( DataTable $dataTable ) : DataTable Template method called from self::manipulate.
manipulateSubtableRequest ( array $request ) : array Remove the flat parameter from the subtable request

Private Methods

Method Description
flattenRow ( Row $row, $rowId, DataTable $dataTable, string $labelPrefix = '', boolean $parentLogo = false )

Method Details

flatten() public method

public flatten ( DataTable $dataTable, string $recursiveLabelSeparator ) : DataTable | Piwik\DataTable\Map
$dataTable Piwik\DataTable
$recursiveLabelSeparator string
return Piwik\DataTable | Piwik\DataTable\Map

flattenDataTableInto() protected method

protected flattenDataTableInto ( $dataTable, $newDataTable, $prefix = '', $logo = false )
$dataTable DataTable
$newDataTable

includeAggregateRows() public method

If the flattener is used after calling this method, aggregate rows will be included in the result. This can be useful when they contain data that the leafs don't have (e.g. conversion stats in some cases).

manipulateDataTable() protected method

Flatten each data table.
protected manipulateDataTable ( DataTable $dataTable ) : DataTable
$dataTable Piwik\DataTable
return Piwik\DataTable

manipulateSubtableRequest() protected method

Remove the flat parameter from the subtable request
protected manipulateSubtableRequest ( array $request ) : array
$request array
return array

Property Details

$recursiveLabelSeparator public property

Separator for building recursive labels (or paths)
public string $recursiveLabelSeparator
return string