src/EntityQueryBuilder.php
public function orderBy($sort, $order = null)
    {
        if (is_string($sort)) {
            $sort = $this->alias($sort);
        }

        parent::orderBy($sort, $order);

        return $this;
    }
public function orderBy($sort, $order = null)
    {
        if (is_string($sort)) {
            $sort = $this->alias($sort);
        }

        parent::orderBy($sort, $order);

        return $this;
    }
Specifies an ordering for the query results.
Replaces any previously specified orderings, if any.

@param string $sort  The ordering expression.
@param string $order The ordering direction.

@return $this This QueryBuilder instance.
@throws \ReflectionException