Closed tobias-kuendig closed 5 years ago
Sometimes more control over sorting is needed than the two column and direction parameters.
column
direction
This PR adds a sortByCallable method that allows a user to specify a custom sort function.
sortByCallable
I need this specific case to implement a sort by random functionality.
sort by random
$sortRandom = function($a, $b) { return random_int(-1, 1); } $jsonq->sortByCallable($sortRandom);
Sometimes more control over sorting is needed than the two
column
anddirection
parameters.This PR adds a
sortByCallable
method that allows a user to specify a custom sort function.I need this specific case to implement a
sort by random
functionality.