LdapTools\Hydrator\HydrateQueryTrait::mergeOrderByAttributes PHP Method

mergeOrderByAttributes() protected method

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