src/LdapTools/Hydrator/HydrateQueryTrait.php
protected function mergeOrderByAttributes(array $attributes, $alias = null)
    {
        if (!$this->isWildCardSelection() && !empty($this->orderBy)) {
            $orderBy = $this->getAttributesForAlias(array_keys($this->orderBy), $alias);
            $lcAttributes = array_map('strtolower', $attributes);
            foreach ($orderBy as $attribute) {
                if (!in_array(strtolower($attribute), $lcAttributes)) {
                    $attributes[] = $attribute;
                }
            }
        }

        return $attributes;
    }
protected function mergeOrderByAttributes(array $attributes, $alias = null)
    {
        if (!$this->isWildCardSelection() && !empty($this->orderBy)) {
            $orderBy = $this->getAttributesForAlias(array_keys($this->orderBy), $alias);
            $lcAttributes = array_map('strtolower', $attributes);
            foreach ($orderBy as $attribute) {
                if (!in_array(strtolower($attribute), $lcAttributes)) {
                    $attributes[] = $attribute;
                }
            }
        }

        return $attributes;
    }
protected function mergeOrderByAttributes ( array $ attributes , $ alias = null ) { if ( ! $ this -> isWildCardSelection ( ) && ! empty ( $ this -> orderBy ) ) { $ orderBy = $ this -> getAttributesForAlias ( array_keys ( $ this -> orderBy ) , $ alias ) ; $ lcAttributes = array_map ( 'strtolower' , $ attributes ) ; foreach ( $ orderBy as $ attribute ) { if ( ! in_array ( strtolower ( $ attribute ) , $ lcAttributes ) ) { $ attributes [ ] = $ attribute ; } } } return $ attributes ; }
If any attributes that were requested to be ordered by are not explicitly in the attribute selection, add them.

@param array $attributes
@param null|string $alias
@return array
If any attributes that were requested to be ordered by are not explicitly in the attribute selection add them .