PHP Class Piwik\DataTable\Filter\ColumnDelete
This filter is used to handle the **hideColumn** and **showColumn** query parameters.
**Basic usage example**
$columnsToRemove = array('nb_hits', 'nb_pageviews');
$dataTable->filter('ColumnDelete', array($columnsToRemove));
$columnsToKeep = array('nb_visits');
$dataTable->filter('ColumnDelete', array(array(), $columnsToKeep));
Show file
Open project: piwik/piwik
Class Usage Examples
Public Methods
Method |
Description |
|
__construct ( DataTable $table, array | string $columnsToRemove, array | string $columnsToKeep = [], boolean $deleteIfZeroOnly = false ) |
Constructor. |
|
filter ( DataTable $table ) : DataTable |
See {@link ColumnDelete}. |
|
Method Details
__construct()
public method
public __construct ( DataTable $table, array | string $columnsToRemove, array | string $columnsToKeep = [], boolean $deleteIfZeroOnly = false ) |
$table |
Piwik\DataTable |
The DataTable instance that will eventually be filtered. |
$columnsToRemove |
array | string |
An array of column names or a comma-separated list of
column names. These columns will be removed. |
$columnsToKeep |
array | string |
An array of column names that should be kept or a
comma-separated list of column names. Columns not in
this list will be removed. |
$deleteIfZeroOnly |
boolean |
If true, columns will be removed only if their value is 0. |
See {@link ColumnDelete}.
public filter ( DataTable $table ) : DataTable |
$table |
Piwik\DataTable |
|
return |
Piwik\DataTable |
|