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;
    }