LdapTools\Query\LdapQuery::getFormattedOrderBy PHP Méthode

getFormattedOrderBy() protected méthode

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