Sets the order of the order

@param string $order

@return static
@throws \InvalidArgumentException
480074
private function setOrder($order)
    {
        if (!\in_array($order, [self::ORDER_ASC, self::ORDER_DESC])) {
            throw new \InvalidArgumentException('Invalid order: ' . $order);
        }

        $this->order = $order;

        return $this;
    }
1269839
public function setIndex($index)
	{
		if ( ! is_numeric($index) || ! is_int(+$index) || $index < 0) {
			throw new \InvalidArgumentException(
				__METHOD__."() expects parameter one, index, to be a positive "
				 ."integer or zero"
			);
		}
		
		$this->index = $index;
		
		return $this;
	}
826952
public function setSortOrder($sortOrder)
    {
        if (!\in_array($sortOrder, ['ASC', 'DESC'])) {
            throw new \InvalidArgumentException(sprintf('The parameter $sortOrder must be one of "ASC" or "DESC", got "%s"', $sortOrder));
        }
        $this->sortOrder = $sortOrder;

        return $this;
    }
1361539
protected function _setOrder()
    {
        $order = $this->_sql->getOrder();
        if (!(is_null($order) || empty($order))) {
            $this->_statement .= " ORDER BY {$order}";
        }
        return $this;
    }
90252
public function setOrder($order)
    {
        if (!in_array($order, [self::ORDER_ASC, self::ORDER_DESC])) {
            throw new LogicException('Invalid order argument.');
        }

        $this->order = $order;

        return $this;
    }
136798
public function sortBy(string $property, string $order = 'asc'): self
    {
        if ($order !== 'asc' && $order !== 'desc') {
            throw new \InvalidArgumentException('The order argument \'asc\' or \'desc\'');
        }
        $this->internalDataListActions[] = ['sortBy', $property, $order];
        return $this;
    }
291227
public function setSortByColumnOrder($order)
    {
        switch ($order) {
            case 'desc':
                $this->sortByColumnOrder = self::SORT_ORDER_DESC;
                break;
            case 'asc':
                $this->sortByColumnOrder = self:: SORT_ORDER_ASC;
                break;
        }

        return $this;
    }
1159098
public function setOrderQTY($orderQty)
    {
        if (!is_array($orderQty)) {
            $this->orderQty = null;

            return false;
        }
        $isValid = true;
        $index = 0;
        while ($isValid && $index < count($orderQty)) {
            if (is_numeric($orderQty[$index]) && $orderQty[$index] > 0) {
                $isValid = true;
            } else {
                $isValid = false;
            }
            $index++;
        }
        if (!$isValid) {
            $this->orderQty = null;

            return false;
        }
        $this->orderQty = $orderQty;

        return true;
    }
72617
protected function prepareOrderAccountOrder(array &$order)
    {
        $this->setItemTotalFormatted($order, $this->price);
        $this->setItemOrderAddress($order, $this->address);
        $this->setItemOrderStoreName($order, $this->store);
        $this->setItemOrderStatusName($order, $this->order);
        $this->setItemOrderPaymentName($order, $this->payment);
        $this->setItemOrderShippingName($order, $this->shipping);
    }
657780
public function setOrderBy(array $orderBy)
    {
        // Validate and force the case for the direction.
        foreach ($orderBy as $attribute => $direction) {
            if (!in_array(strtoupper($direction), self::ORDER)) {
                throw new \InvalidArgumentException(sprintf(
                    'Order direction "%s" is invalid. Valid values are ASC and DESC',
                    $direction
                ));
            }
            $orderBy[$attribute] = strtoupper($direction);
        }
        $this->orderBy = $orderBy;

        return $this;
    }
52359
public function sort($sort)
    {
        if (null !== $sort && !is_array($sort)) {
            throw new \InvalidArgumentException(sprintf('The sort "%s" is not valid.', $sort));
        }

        $this->sort = $sort;

        return $this;
    }
320577
public function setOrder(string $order, string $direction): self
    {
        return $this->setParam('order', [$order => $direction]);
    }
765418
public function order($field, $order = '')
    {
        if (is_array($field)) {
            $this->options['sort'] = $field;
        } else {
            $this->options['sort'][$field] = 'asc' == strtolower($order) ? 1 : -1;
        }
        return $this;
    }
729583
public function addOrder(Order $order)
    {
        if (count($this->orders)+1 >= self::MAX_NUM_ORDERS)
        {
            throw new Exception('Cannot have more than '.self::MAX_NUM_ORDERS.' Orders in a single Order Collection');
        }

        $this->orders[] = $order;
        $order->setCollection($this);
    }
1334261
public function orderBy($column, $order = Order::ASC)
    {
        $this->orders[] = [$column, $order];
        return $this;
    }
487158
public function order($order, $type = 'DESC')
    {

        $this->string['order'] .= $this->useBuilder('order')
            ->order($order, $type);

        return $this;
    }
153223
public function order($field, $order = 'desc')
    {
        $field = $this->model->field($field);
        $order = $this->normalizeOrder($order);

        $this->builder->addOrderBy($this->connection->quoteIdentifier($field->mappedName()), $order);

        return $this;
    }