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; }
Наследование: extends Piwik\DataTable\BaseFilter
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$mappingToApply

Открытые методы

Метод Описание
__construct ( DataTable $table, array | null $mappingToApply = null ) Constructor.
filter ( DataTable $table ) See {@link ReplaceColumnNames}.

Защищенные методы

Метод Описание
filterSimple ( Piwik\DataTable\Simple $table )
filterTable ( DataTable $table )
flattenGoalColumns ( $columnValue ) : array
getRenamedColumn ( $column )
getRenamedColumns ( array $columns ) : array Checks the given columns and renames them if required

Описание методов

__construct() публичный Метод

Constructor.
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.

filter() публичный Метод

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() защищенный Метод

protected flattenGoalColumns ( $columnValue ) : array
$columnValue
Результат array

getRenamedColumn() защищенный Метод

protected getRenamedColumn ( $column )

getRenamedColumns() защищенный Метод

Checks the given columns and renames them if required
protected getRenamedColumns ( array $columns ) : array
$columns array
Результат array

Описание свойств

$mappingToApply защищенное свойство

protected $mappingToApply