Sets th order by

@param string $sort      the sorting property
@param string $direction the direciton ordering property

@return EfficientPaginator This query object.
967264
public function setOrderBy($sort, $direction = 'ASC')
    {
        $this->sort = $sort;
        $this->direction = $direction;
        return $this;
    }
707440
public function orderBy($column, $direction = Table::ORDER_ASC) {
        $this->orderBy[] = '`' . Util::camelTo_($column) . '` ' . $direction;
        return $this;
    }
506428
public function orderBy(
        string $cypher,
        string $direction = 'ASC'
    ): self {
        $direction = \strtolower($direction);

        $query = new self;
        $query->clauses = $this->clauses->add(
            Clause\OrderByClause::$direction($cypher)
        );

        return $query;
    }
155163
public function addOrderBy(AttributeQueryBuilderInterface $attributeQueryBuilder, $direction = null)
    {
        $this->queryBuilder->addOrderBy($attributeQueryBuilder->applyJoin()->getColumn(), $direction);

        return $this;
    }
1098755
final public function orderBy(string $memberExpression, string $direction)
    {
        $this->orderings[] = new MemberOrdering(
            $this->memberExpressionParser->parse($this->class, $memberExpression),
            $direction
        );

        return $this;
    }
1056687
public function sort($attribute, $direction = SORT_ASC)
    {
        if ($direction === SORT_DESC) {
            $attribute = '-' . $attribute;
        }

        if ($this->offsetExists('sort')) {
            $attribute = $this->offsetGet('sort') . ',' . $attribute;
        }

        $this->offsetSet('sort', $attribute);

        return $this;
    }
553061
public function orderBy(string $axisName, string $direction)
    {
        $axis = $this->structure->getAxis($axisName);

        $this->orderings[] = new AxisOrdering($axis, $direction);

        return $this;
    }
394423
public function setDirection($direction)
    {
        if ($direction !== self::DIRECTION_FORWARD && $direction !== self::DIRECTION_REVERSE && $direction !== self::DIRECTION_BOTH) {
            throw new InvalidArgumentException('Invalid direction given');
        }
        $this->direction = $direction;

        return $this;
    }
493180
public function sortBy($field, $direction = 'asc', $flags = null)
    {
        $this->sortByField = $field;

        // Normalize direction.
        $direction = strtolower($direction);

        if ($direction === 'asc' || $direction === 'desc') {
            $this->sortByDirection = $direction;
        }

        if (is_null($flags)) {
            $this->sortByFlags = SORT_NATURAL + SORT_FLAG_CASE;
        }

        return $this;
    }
1273836
public function order($column, $direction = 'asc')
    {
        $this->set('orderby', $column);
        $this->set('ordertype', $direction);

        return $this;
    }
1220238
protected function buildOrder($query, $filter, $order, $direction)
    {
        if (!empty($order)) {
            $direction = empty($direction) ? 'asc' : $direction;
            $query     = $query->orderBy($order, $direction);
        }

        return $query;
    }
207124
public function orderBy($key, $direction = 'ASC')
    {
        if (Helpers\Validate::table($this->name)->field($key))
        {
            $directions                        = array(
                'ASC'  => SORT_ASC,
                'DESC' => SORT_DESC
            );
            $this->pending[__FUNCTION__][$key] = isset($directions[$direction]) ? $directions[$direction] : 'ASC';
        }

        return $this;
    }
421615
public function sortByDefault(string $direction = 'asc'): TableListColumn
    {
        // we check if the method has already been called
        if ($this->getAttribute('tableList')->sortBy || $this->getAttribute('tableList')->sortDir) {
            $errorMessage = 'The « sortByDefault() » method has already been called. '
                            . 'You only can sort a column by default once.';
            throw new ErrorException($errorMessage);
        }
        // we set the sort attribute
        $this->getAttribute('tableList')->sortBy = $this->getAttribute('attribute');
        // we set the sort direction
        $acceptedDirections = ['asc', 'desc'];
        $errorMessage = 'Invalid « $direction » argument for « sortByAttribute() » method. Has to be « asc » or '
                        . '« desc ». « ' . $direction . ' » given.';
        if (! in_array($direction, $acceptedDirections)) {
            throw new InvalidArgumentException($errorMessage);
        }
        $this->getAttribute('tableList')->setAttribute('sortDir', $direction);

        return $this;
    }
532639
public function setOrder($mode, $direction = self::DIRECTION_ASC)
    {
        $this->orderMode = $mode;
        $this->orderDirection = $direction;
    }
1312248
public function order($direction = null)
    {
        if (is_null($direction)) {
            $direction = $this->getOrderDirection();
        } else {
            $this->setOrderDirection($direction);
        }

        // if a direction is set
        if (!empty($direction)) {
            if (!is_string($this->order) && is_callable($this->order)) {
                call_user_func_array($this->order, $this);
            } else {

                $table = $this->getTable();

                // verify that source is a query
                if (!$table->isSourceQueryBuilder()) {
                    throw new \Exception('Table source is not an instance of query builder');
                }

                $table->getSource()->orderBy($this->order, $direction);
            }
        }

        return $this;
    }
605048
public function setOrderBy($field, $direction = null)
    {
        if (empty($field))
            return $this;

        if (count($order = explode(' ', $field)) == 2) {
            $field = $order[0];
            $direction = $order[1];
        }
        $this->orderBy[$field] = empty($direction) ? 'ASC' : $direction;
        return $this;
    }
672751
public function orderBy($fields, $direction = false)
    {
        $this->orderBy->addFields($fields, $direction);

        return $this;
    }