src/LdapTools/Query/LdapQuery.php
protected function getFormattedOrderBy($selected, $aliases)
    {
        if (!empty($aliases) && !$this->isWildCardSelection()) {
            $orderBy = [];
            foreach ($this->orderBy as $attribute => $direction) {
                list($alias, $attr) = LdapUtilities::getAliasAndAttribute($attribute);
                $orderAttr = AttributeNameResolver::arraySearchGetValue($attr, $selected);
                $orderAttr = $alias ? "$alias.$orderAttr" : $orderAttr;
                $orderBy[$orderAttr] = $direction;
            }
        } else {
            $orderBy = $this->orderBy;
        }

        return $orderBy;
    }
protected function getFormattedOrderBy($selected, $aliases)
    {
        if (!empty($aliases) && !$this->isWildCardSelection()) {
            $orderBy = [];
            foreach ($this->orderBy as $attribute => $direction) {
                list($alias, $attr) = LdapUtilities::getAliasAndAttribute($attribute);
                $orderAttr = AttributeNameResolver::arraySearchGetValue($attr, $selected);
                $orderAttr = $alias ? "$alias.$orderAttr" : $orderAttr;
                $orderBy[$orderAttr] = $direction;
            }
        } else {
            $orderBy = $this->orderBy;
        }

        return $orderBy;
    }
protected function getFormattedOrderBy ( $ selected , $ aliases ) { if ( ! empty ( $ aliases ) && ! $ this -> isWildCardSelection ( ) ) { $ orderBy = [ ] ; foreach ( $ this -> orderBy as $ attribute => $ direction ) { list ( $ alias , $ attr ) = LdapUtilities :: getAliasAndAttribute ( $ attribute ) ; $ orderAttr = AttributeNameResolver :: arraySearchGetValue ( $ attr , $ selected ) ; $ orderAttr = $ alias ? "$alias.$orderAttr" : $ orderAttr ; $ orderBy [ $ orderAttr ] = $ direction ; } } else { $ orderBy = $ this -> orderBy ; } return $ orderBy ; }
This formats the orderBy array to ignore case differences between the orderBy name and the actually selected name,
such as for sorting arrays.

@param $selected
@param $aliases
@return array
This formats the orderBy array to ignore case differences between the orderBy name and the actually selected name such as for sorting arrays .