private function applyOrdering($matches)
    {
        foreach ($this->ordering as $ordering) {
            usort(
                $matches,
                function ($aRow, $bRow) use ($ordering) {
                    $a = $aRow[$ordering['column']];
                    $b = $bRow[$ordering['column']];

                    return $ordering['direction'] * ($a == $b ? 0 : ($a < $b ? -1 : 1));
                }
            );
        }

        return $matches;
    }
private function applyOrdering($matches)
    {
        foreach ($this->ordering as $ordering) {
            usort(
                $matches,
                function ($aRow, $bRow) use ($ordering) {
                    $a = $aRow[$ordering['column']];
                    $b = $bRow[$ordering['column']];

                    return $ordering['direction'] * ($a == $b ? 0 : ($a < $b ? -1 : 1));
                }
            );
        }

        return $matches;
    }
private function applyOrdering ( $ matches ) { foreach ( $ this -> ordering as $ ordering ) { usort ( $ matches , function ( $ aRow , $ bRow ) use ( $ ordering ) { $ a = $ aRow [ $ ordering [ 'column' ] ] ; $ b = $ bRow [ $ ordering [ 'column' ] ] ; return $ ordering [ 'direction' ] * ( $ a == $ b ? 0 : ( $ a < $ b ? - 1 : 1 ) ) ; } ) ; } return $ matches ; }
Apply the ordering

@param   array $matches The records

@return  array
Apply the ordering