We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b225c52 commit e53e3fdCopy full SHA for e53e3fd
src/Jsonq.php
@@ -435,6 +435,27 @@ public function sortBy($column, $order = 'asc')
435
return $this;
436
}
437
438
+ /**
439
+ * Sort prepared data using a custom sort function.
440
+ *
441
+ * @param callable $sortFunc
442
443
+ * @return object|array|null
444
+ * @throws ConditionNotAllowedException
445
+ */
446
+ public function sortByCallable(callable $sortFunc)
447
+ {
448
+ $this->prepare();
449
+
450
+ if (!is_array($this->_map)) {
451
+ return $this;
452
+ }
453
454
+ usort($this->_map, $sortFunc);
455
456
457
458
459
/**
460
* Sort an array value
461
*
0 commit comments