PHP Class Piwik\Metrics\Sorter

Afficher le fichier Open project: piwik/piwik Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( Config $config )
getBestSortFlags ( DataTable $table, string | integer $columnToSort ) : integer
getPrimaryColumnToSort ( DataTable $table, string | integer $columnToSort ) : integer Detect the column to be used for sorting
getPrimarySortOrder ( string $order ) : integer
getSecondaryColumnToSort ( Row $row, integer | string $primaryColumnToSort ) : integer Detect the secondary sort column to be used for sorting
getSecondarySortOrder ( string $order, string | integer $secondarySortColumn ) : integer
sort ( DataTable $table ) Sorts the DataTable rows using the supplied callback function.

Private Methods

Méthode Description
getColumnValue ( Row $row )
getStringSortFlags ( )

Method Details

__construct() public méthode

public __construct ( Config $config )
$config Piwik\Metrics\Sorter\Config

getBestSortFlags() public méthode

public getBestSortFlags ( DataTable $table, string | integer $columnToSort ) : integer
$table Piwik\DataTable
$columnToSort string | integer A column name or column id. Make sure that column actually exists in the row. You might want to get a valid column via {@link getPrimaryColumnToSort()} or {@link getSecondaryColumnToSort()}
Résultat integer

getPrimaryColumnToSort() public méthode

Detect the column to be used for sorting
public getPrimaryColumnToSort ( DataTable $table, string | integer $columnToSort ) : integer
$table Piwik\DataTable
$columnToSort string | integer column name or column id
Résultat integer

getPrimarySortOrder() public méthode

public getPrimarySortOrder ( string $order ) : integer
$order string 'asc' or 'desc'
Résultat integer

getSecondaryColumnToSort() public méthode

Detect the secondary sort column to be used for sorting
public getSecondaryColumnToSort ( Row $row, integer | string $primaryColumnToSort ) : integer
$row Piwik\DataTable\Row
$primaryColumnToSort integer | string
Résultat integer

getSecondarySortOrder() public méthode

public getSecondarySortOrder ( string $order, string | integer $secondarySortColumn ) : integer
$order string 'asc' or 'desc'
$secondarySortColumn string | integer column name or column id
Résultat integer

sort() public méthode

Sorts the DataTable rows using the supplied callback function.
public sort ( DataTable $table )
$table Piwik\DataTable The table to sort.