Adds sort

@param *string $column Column name
@param string  $order  ASC or DESC

@return Search
173308
public function addSort($column, $order = self::ASC)
    {
        if ($order != self::DESC) {
            $order = self::ASC;
        }

        $this->sort[$column] = $order;

        return $this;
    }
412749
public function groupBy(string $column, string $order = null): self
    {
        $this->groupBy[] = [
            'column' => $column,
            'order'  => $order,
        ];

        return $this;
    }
816399
public function orderBy($column = '', $sort = 'desc')
    {
        $column=self::sanitize($column);
        $sort=strtoupper(self::sanitize($sort));

        /*check if the sort method passed is valid */
        if (!(hash_equals('DESC',$sort) || hash_equals('ASC',$sort))){
            static::$response["status"] = "error";
            static::$response["response"] = "The sort order in order by clause is invalid";
            static::$response['code'] = 6050;
            return static::terminate(static::$response);
        }

        if ($this->order == null) {
            $this->order = " ORDER BY $column $sort";
        } else {
            $this->order .= ", $column $sort";
        }
        return $this;
    }
46106
public function orderBy($column, $order = 'ASC')
    {
        if ($this->sql['orderBy'] == '') {
            $this->sql['orderBy'] = "ORDER BY {$column} {$order} ";
        } else {
            $this->sql['orderBy'] .= ", {$column} {$order} ";
        }
        return $this;
    }
23696
public function orderBy($column, $order = self::ORDER_BY_ASC)
    {
        $this->orderBy[] = array('column' => $column,
            'order' => $order);

        return $this;
    }
267733
public function sort($order = SORT_ASC, $strategy = SORT_REGULAR, $preserveKeys = false)
    {
        $this->sorting($this->elements, $order, $strategy, $preserveKeys);

        return $this;
    }
1214433
public function sortBy($field, $order = 'ASC')
    {
        //argument test
        Argument::i()
            //Argument 1 must be a string
            ->test(1, 'string')
            //Argument 2 must be a string
            ->test(2, 'string');
        
        $this->sortBy[] = $field . ' ' . $order;
        
        return $this;
    }
77129
public function orderBy($column, $direction = 'ASC')
    {
        $this->ordering[$this->applyTableAlias($column)] = $direction;

        return $this;
    }
174528
public function sort ($sort_on, $order = 'desc') {
		$queryString = '<FieldRef Name="'  .$sort_on . '" Ascending="' . $this->api->getSortFromValue($order) . '" />';
		$this->sort_caml = '<OrderBy>' . $queryString . '</OrderBy>';

		return $this;
	}
1287746
public function sortBy($columnName, $asc = TRUE) {

		$sort = new \stdClass();

		$sort->column = $columnName;
		$sort->asc = !!$asc;

		$this->columnSorts[] = $sort;

		return $this;

	}
2310
public function byFunction(
        string $function,
        string $order
    ): SortBy {
        $this->sortsBy[] = [
            'type' => self::TYPE_FUNCTION,
            'function' => $function,
            'order' => $order,
        ];

        return $this;
    }
244977
public function orderBy($order) 
    {
        
        $this->sql .= ' ORDER BY ';
        
        foreach($order as $column) {
            $this->sql .= $this->quoteColumnName($column[0]) .' '. $column[1] . ', ';
        }
        
        $this->sql = trim($this->sql, ', ');
        
        return $this;
    }
704072
public function order_by( $cols, $order = 'asc' ) 
	{
		if ( !is_array( $cols ) ) 
		{
			$this->orders[] = array( $cols, $order ); return $this;
		}
		else
		{
			foreach( $cols as $key => $col ) 
			{
				if ( is_numeric( $key ) ) 
				{
					$this->orders[] = array( $col, $order );	
				} 
				else 
				{
					$this->orders[] = array( $key, $col );
				}
			}
		}
		
		return $this;
	}
1114219
public function orderBy($sort, $order = 'ASC') {
        if ($order == 'ASC' || $order == 'DESC') {
            $this->q->apd(' ORDER BY ' . $sort . ' ' .$order);
        } else {
            $this->setError('q', 'No valid order');
            return false;
        }

        return $this;
    }
699001
public function orderBy($field, $order = 'ASC')
    {
        if(is_string($field) && trim($field) != '') {
            $field = trim($field);
            $field = ltrim($field, 'ORDER BY ');
            $this->order = ' ORDER BY `'.$field.'`'.(($order == 'DESC') ? ' DESC' : ' ASC');
        }
        return $this;
    }
828132
public function orderDesc(string $column)
    {
        $instance = $this->orderByStrategyInstance();

        $instance->orderByStrategy()->orderDesc($column);

        return $instance;
    }
910669
public function setOrder($order)
    {
        $order = in_array($order, ['ASC', 'DESC']) ? $order : 'ASC';

        $this->order = $order;

        return $this;
    }