LdapTools\Query\LdapResultSorter::resultSortCallback PHP Method

resultSortCallback() protected method

Goes through each orderBy value to run a comparison to determine the value to pass back to usort.
protected resultSortCallback ( mixed $a, mixed $b ) : integer
$a mixed
$b mixed
return integer
    protected function resultSortCallback($a, $b)
    {
        $retVal = 0;
        foreach ($this->orderBy as $attribute => $direction) {
            if ($retVal === 0) {
                $retVal = $this->getUsortReturnValue($attribute, $direction, $a[1], $b[1]);
            }
        }
        return $retVal === 0 ? $a[0] - $b[0] : $retVal;
    }