/** * @link http://www.php.net/manual/en/function.array-multisort.php#90917 * @return Closure */ public function getSortingCallback() { //need to perform a multisort using callbacks... which PHP can't do natively $previousCallback = $this->previousQuery->getSortingCallback(); $currentCallback = Util::getDefaultSortCallback($this->getLambdaExpression(), $this->isDescending()); return function ($a, $b) use($previousCallback, $currentCallback) { $previousValue = $previousCallback($a, $b); if ($previousValue !== 0) { return $previousValue; } return $currentCallback($a, $b); }; }
public function getSortingCallback() { $lambda = $this->getLambdaExpression(); return Util::getDefaultSortCallback($lambda, $this->isDescending()); }