PHP Класс Piwik\DataTable\Filter\ReplaceColumnNames
If no mapping is provided, this column will use one that maps index metric names
(which are integers) with their string column names. In the database, reports are
stored with integer metric names because it results in blobs that take up less space.
When loading the reports, the column names must be replaced, which is handled by this
class. (See {@link Piwik\Metrics} for more information about integer metric names.)
**Basic example**
filter use in a plugin's API method
public function getMyReport($idSite, $period, $date, $segment = false, $expanded = false)
{
$dataTable = Archive::createDataTableFromArchive('MyPlugin_MyReport', $idSite, $period, $date, $segment, $expanded);
$dataTable->queueFilter('ReplaceColumnNames');
return $dataTable;
}
Показать файл
Открыть проект
Защищенные свойства (Protected)
Открытые методы
Метод |
Описание |
|
__construct ( DataTable $table, array | null $mappingToApply = null ) |
Constructor. |
|
filter ( DataTable $table ) |
See {@link ReplaceColumnNames}. |
|
Защищенные методы
Описание методов
__construct()
публичный Метод
public __construct ( DataTable $table, array | null $mappingToApply = null ) |
$table |
Piwik\DataTable |
The table that will be eventually filtered. |
$mappingToApply |
array | null |
The name mapping to apply. Must map old column names
with new ones, eg,
array('OLD_COLUMN_NAME' => 'NEW_COLUMN NAME',
'OLD_COLUMN_NAME2' => 'NEW_COLUMN NAME2')
If null, {@link Piwik\Metrics::$mappingFromIdToName} is used. |
See {@link ReplaceColumnNames}.
public filter ( DataTable $table ) |
$table |
Piwik\DataTable |
|
filterSimple()
защищенный Метод
protected filterSimple ( Piwik\DataTable\Simple $table ) |
$table |
Piwik\DataTable\Simple |
|
filterTable()
защищенный Метод
protected filterTable ( DataTable $table ) |
$table |
Piwik\DataTable |
|
flattenGoalColumns()
защищенный Метод
getRenamedColumn()
защищенный Метод
getRenamedColumns()
защищенный Метод
Checks the given columns and renames them if required
Описание свойств
$mappingToApply защищенное свойство
protected $mappingToApply |