Add a ORDER BY clause

@param string $cypher
@param string $direction

@return self
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;
    }
737241
public function orderBy(string $field, int $direction = self::ASCENDING): DocumentSelector
    {
        return $this->sortBy($this->sortBy + [$field => $direction]);
    }
381001
public function limit(string $cypher): self
    {
        $query = new self;
        $query->clauses = $this->clauses->add(
            new Clause\LimitClause($cypher)
        );

        return $query;
    }
727294
public function orderBy(string $componentId, string $direction)
    {
        $this->rowCriteria->orderBy($componentId, $direction);

        return $this;
    }
357482
public function addOrderBy(string $name, string $direction = self::ORDER_ASC): void
    {
        $this->order[$name] = $direction;
        $this->updateUriQuery();
    }
1205950
public function orderBy(string $key, string $direction = 'ASC'): SelectQueryBuilder
    {
        array_push($this->orderBy, [
            'key' => $key,
            'direction' => strtoupper($direction),
        ]);
        return $this;
    }
512277
public function orderBy($column, $direction = IQueryBuilder::ORDER_ASC)
    {
        if ($direction == IQueryBuilder::ORDER_ASC || $direction == IQueryBuilder::ORDER_DESC) {
            $this->orderConditions[$column] = $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;
    }
177720
public function remove(string $cypher): self
    {
        $query = new self;
        $query->clauses = $this->clauses->add(
            new Clause\RemoveClause($cypher)
        );

        return $query;
    }
112225
public function order($order, $direction = self::ASC)
    {
        $this->order = $order;
        $this->direction = $direction;
        return $this;
    }
1274904
protected function sortBy($field, $direction) {

        if (!in_array($direction, [DoplioDbTable::SORT_ASC, DoplioDbTable::SORT_DESC])) {
            throw new \InvalidArgumentException(sprintf('%s is an invalid sort direction'), $direction);
        }

        $this->specificationQuery->orderBy($field, $direction);
        return $this;
    }
716832
public function scopeSort(Builder $query, $column, $direction)
    {
        if (!in_array($column, $this->sortable)) {
            return $query;
        }

        return $query->orderBy($column, $direction);
    }
358857
function orderBy( $column, $direction = "ASC" ) {

        $clone = clone $this;

        if ($direction===true) {
            $clone->orderBy[] = $column;
        }else{
            $clone->orderBy[] = $this->db->quoteIdentifier( $column ) . " " . $direction;
        }

        return $clone;

    }
482727
public function sort($element, $direction)
    {
        // simple sorting
        if (in_array($element, $sortable = app('scaffold.module')->sortable(), true)) {
            if ($table = app('scaffold.module')->model()->getTable()) {
                $element = "{$table}.{$element}";
            }

            $this->query->orderBy($element, $direction);
        }

        if (array_key_exists($element, $sortable) && is_callable($callback = $sortable[$element])) {
            $this->query = call_user_func_array($callback, [$this->query, $element, $direction]);
        }

        if (array_key_exists($element, $sortable) && is_string($handler = $sortable[$element])) {
            $handler = new $handler($this->query, $element, $direction);
            if (!$handler instanceof QueryBuilder || !method_exists($handler, 'build')) {
                throw new \Exception('Handler class must implement '.QueryBuilder::class.' contract');
            }
            $this->query = $handler->build();
        }

        return $this;
    }
1360658
public function orderBy($key, $direction = self::ORDER_ASC, $tableName = null)
    {
        if (!$tableName) {
            $tableName = $this->getTableName();
        }
        $this->orderBy[] = ['key' => $key, 'direction' => $direction, 'tableName' => $tableName];
        return $this;
    }
8414
public function sortBy(string $field, string $direction = 'asc'): self
    {
        $this->sortBy = [$field, $direction];

        return $this;
    }
594036
public function orderBy($field, $direction = NULL) {
        $order["field"] = $field;
        if (is_null($direction)) {
            $order["direction"] = "ASC";
        } else {
            $order["direction"] = $direction;
        }
        $this->orders[] = $order;
        return $this;
    }