lib/IgraalOSL/StatsTable/StatsTable.php
public function uSortMultipleColumn($columns)
    {
        $dataFormats = $this->dataFormats;
        $sort = function ($a, $b) use ($columns, $dataFormats) {
            foreach ($columns as $colName => $fn) {
                $tmp = $fn($a[$colName], $b[$colName]);
                if ($tmp !== 0) {
                    return $tmp;
                }
            }
            return 0;
        };

        uasort($this->data, $sort);
        return $this;
    }
public function uSortMultipleColumn($columns)
    {
        $dataFormats = $this->dataFormats;
        $sort = function ($a, $b) use ($columns, $dataFormats) {
            foreach ($columns as $colName => $fn) {
                $tmp = $fn($a[$colName], $b[$colName]);
                if ($tmp !== 0) {
                    return $tmp;
                }
            }
            return 0;
        };

        uasort($this->data, $sort);
        return $this;
    }
public function uSortMultipleColumn ( $ columns ) { $ dataFormats = $ this -> dataFormats ; $ sort = function ( $ a , $ b ) use ( $ columns , $ dataFormats ) { foreach ( $ columns as $ colName => $ fn ) { $ tmp = $ fn ( $ a [ $ colName ] , $ b [ $ colName ] ) ; if ( $ tmp !== 0 ) { return $ tmp ; } } return 0 ; } ; uasort ( $ this -> data , $ sort ) ; return $ this ; }
Sort stats table by multiple column with a custom compare function
@param $columns $columns Associative array : KEY=> column name (string), VALUE=> Custom function (function)
@return $this
Sort stats table by multiple column with a custom compare function