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;
    }