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

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

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

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

        return $this;
    }
public function addOrderBy ( $ sort , $ order = null ) { if ( is_string ( $ sort ) ) { $ sort = $ this -> alias ( $ sort ) ; } parent :: addOrderBy ( $ sort , $ order ) ; return $ this ; }
Adds an ordering to the query results.

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

@return $this This QueryBuilder instance.
@throws \ReflectionException
Adds an ordering to the query results .