Build the order clause

@param   array|string $columns   A string or array of ordering columns
@param   string       $direction Either DESC or ASC
@return  $this
778586
public function order($columns, $direction = 'ASC')
    {
        foreach ((array) $columns as $column)
        {
            $this->order[] = array(
                'column'    => $column,
                'direction' => $direction
            );
        }

        return $this;
    }
343059
public function orderBy($field, $direction = 'ASC')
    {
        $this->builderCache->store('orderBy', [$field => strtoupper($direction)]);

        return $this;
    }
1171992
public function sort($field, $direction = self::SORT_DESC) {
		if(empty($this->data['sorts'])) {
			$this->data['sorts'] = array();
		}
		$this->data['sorts'][] = array(
			'field' => $field,
			'direction' => $direction
		);
		return $this;
	}
1082579
public function columns(string $column, string ...$columns)
    {
        array_unshift($columns, $column);

        foreach ($columns as $column) {
            $this->column($column);
        }

        return $this;
    }
941018
public function sortBy($column, $direction = 'asc')
    {
        $this->sortBy = $column;
        if (in_array(strtolower($direction), array('asc', 'desc'))) {
            $this->sortByDirection = $direction;
        } else {
            $this->sortByDirection = 'asc';
        }
    }
8414
public function sortBy(string $field, string $direction = 'asc'): self
    {
        $this->sortBy = [$field, $direction];

        return $this;
    }
1297858
final public function orderBy($column, $way = "DESC")
    {
        $column = $this->formatColumn($column);
        $this->_sql['order'][] = [$column, $way];
        return $this;
    }
456469
public function orderBy($fields, string $direction = 'ASC'): IQueryBuilderHandler
    {
        if (\is_array($fields) === false) {
            $fields = [$fields];
        }

        foreach ((array)$fields as $key => $value) {
            $field = $key;
            $type = $value;

            if (\is_int($key) === true) {
                $field = $value;
                $type = $direction;
            }

            if (($field instanceof Raw) === false) {
                $field = $this->addTablePrefix($field);
            }

            $this->statements['orderBys'][] = compact('field', 'type');
        }

        return $this;
    }
926970
public function orderBy($columns, $order = 'ASC', $nulls = null)
    {
        return $this->buildSelect()->orderBy($columns, $order, $nulls);
    }
978536
public function orderBy($column, $asc = true)
    {
        if ($asc) {
            $this->orders[] = $this->grammar->buildId($column) . ' ASC';
        } else {
            $this->orders[] = $this->grammar->buildId($column) . ' DESC';
        }

        return $this;
    }
428041
public function apply($query, $column, $direction = 'asc')
    {
        $direction = $direction === 'desc' ? 'desc' : 'asc';

        if ($query instanceof Model) {
            $query = $query->query();
        }

        $query = $this->applyNullLastQuery($query, $column);

        return $query->orderBy($column, $direction);
    }
1229390
public function columns($columns = array())
    {
        foreach ((array) $columns as $key => $value)
        {
            if (is_string($key)) {
                $this->columns[$key] = $value;
            } else {
                $this->columns[] = $value;
            }
        }

        return $this;
    }
1141580
public function order_by($field, $table, $direction = '') {
        $direction = self::normalize_direction($direction);
        $this->order[] = self::resolve_field($field, $table) . ' ' . $direction;
    }
110291
public function orderBy($key, $direction = \Parable\ORM\Query::ORDER_ASC)
    {
        $this->orderBy = ['key' => $key, 'direction' => $direction];
        return $this;
    }
1363094
public function orderBy($column, $how = 'ASC')
    {
        if (!array_key_exists('order_by', $this->query)) {
            $this->query['order_by'] = array();
        }

        // Multiple?
        if (is_array($column)) {
            foreach ($column as $col => $how) {
                $this->orderBy($col, $how);
            }
        } else {
            $this->query['order_by'][] = $this->columnName($column) . " {$how}";
        }
        return $this;
    }
1155401
public function sortby($column, $direction= 'ASC') {
        /* The direction can only be ASC or DESC; anything else is bogus */
        if (!in_array(strtoupper($direction), array('ASC', 'DESC', 'ASCENDING', 'DESCENDING'), true)) {
            $direction = '';
        }

        if (!static::isValidClause($column)) {
            $this->xpdo->log(xPDO::LOG_LEVEL_ERROR, 'SQL injection attempt detected in sortby column; clause rejected');
        } elseif (!empty($column)) {
            $this->query['sortby'][] = array('column' => $column, 'direction' => $direction);
        }
        return $this;
    }
1652
public function columns($columns)
  {
    if ( is_null($this->columns) ){
      $this->columns = new Element('()', $columns);
    }
    else {
      $this->columns->append($columns);
    }

    return $this;
  }