Set the order of branches in the tree.

@param array $order

@return void
771495
protected static function setBranchOrder(array $order)
    {
        static::$branchOrder = array_flip(Arr::flatten($order));

        static::$branchOrder = array_map(function ($item) {
            return ++$item;
        }, static::$branchOrder);
    }
715873
public function setOrder($order)
    {
        if (! is_array($order)) {
            $order = func_get_args();
        }

        $this->order = $order;

        return $this;
    }
1047286
private function _prepareOrderBy(array $orderByArray)
	{
		if(count($orderByArray) === 1)
		{
			foreach($orderByArray as $orderMode => $column)
			{
				$this->orderBy = 'ORDER BY ' . $column->getColumnName() . ' ' . $orderMode . ' ';
			}
		}
	}
1033226
public function add(array $order)
    {
        $result = null;
        $this->hook->attach('order.add.before', $order, $result, $this);

        if (isset($result)) {
            return (int) $result;
        }

        unset($order['order_id']); // In case the order is cloning
        $order['created'] = $order['modified'] = GC_TIME;
        $order += array('status' => $this->getDefaultStatus());

        $this->prepareComponents($order);

        $result = $this->db->insert('orders', $order);
        $this->hook->attach('order.add.after', $order, $result, $this);
        return (int) $result;
    }
697503
private function setOrderState($order, $state)
    {
        $prevState = $order->getState();
        if ($state == OrderModel::STATE_HOLDED) {
            // Ensure order is in one of the "can hold" states [STATE_NEW | STATE_PROCESSING]
            // to avoid no state on admin order unhold
            if ($prevState != OrderModel::STATE_NEW) {
                $order->setState(OrderModel::STATE_PROCESSING);
                $order->setStatus($order->getConfig()->getStateDefaultStatus(OrderModel::STATE_PROCESSING));
            }
            try {
                $order->hold();
            } catch (\Exception $e) {
                // Put the order in "on hold" state even if the previous call fails
                $order->setState(OrderModel::STATE_HOLDED);
                $order->setStatus($order->getConfig()->getStateDefaultStatus(OrderModel::STATE_HOLDED));
            }
        } elseif ($state == OrderModel::STATE_CANCELED) {
            try {
                $order->cancel();
                $order->setState(OrderModel::STATE_CANCELED);
                $order->setStatus($order->getConfig()->getStateDefaultStatus(OrderModel::STATE_CANCELED));
            } catch (\Exception $e) {
                // Put the order in "canceled" state even if the previous call fails
                $order->setState(OrderModel::STATE_CANCELED);
                $order->setStatus($order->getConfig()->getStateDefaultStatus(OrderModel::STATE_CANCELED));
            }
        } else {
            $order->setState($state);
            $order->setStatus($order->getConfig()->getStateDefaultStatus($state));
        }
    }
1031421
public function setColumnsOrder($order)
	{
		$new_order = [];

		foreach ($order as $key) {
			if (isset($this->columns[$key])) {
				$new_order[$key] = $this->columns[$key];
			}
		}

		if (sizeof($new_order) === sizeof($this->columns)) {
			$this->columns = $new_order;
		} else {
			throw new DataGridException('When changing columns order, you have to specify all columns');
		}

		return $this;
	}
51949
@Override
    public void setOrder(char order) {
        Preconditions.checkArgument(order == 'c' || order == 'f', "Order specified must be either c or f: got %s", String.valueOf(order));
        this.order = order;
    }
478780
public function setOrder(\Librinfo\EcommerceBundle\Entity\Order $order = null)
    {
        $this->order = $order;

        return $this;
    }
1147233
public function setAllowOrders(array $orders = []): void
    {
        $this->allowOrders = [];
        foreach ($orders as $column) {
            $this->addAllowOrder($column);
        }
    }
541732
public function thenBy($order)
    {
        $order = LambdaUtils::toSelectCallable($order);
        $this->orders[] = array("property" => $order, "direction" => self::ORDER_ASC);
        return $this;
    }
731978
public function sort($order = 'asc')
    {
        if ($order == 'desc') {
            rsort($this->_map);
        }else{
            sort($this->_map);
        }

        return $this;
    }
1166247
public function setSort($fieldName, $order = 'asc'): self
    {
        if (null !== $fieldName) {
            $sort = [];
            $fields = is_array($fieldName) ? $fieldName : [$fieldName => $order];

            foreach ($fields as $fieldName => $order) {
                $sort[] = [$fieldName => $order];
            }
        } else {
            $sort = null;
        }

        $this->sort = $sort;

        return $this;
    }
425113
public function addOrderBy(string $orderBy, string $order)
    {
        if ($this->sql['orderby'] === null) {
            $this->sql['orderby'] = " ORDER BY ".$orderBy." ".$order." ";
        } else {
            $this->sql['orderby'] .= " , ".$orderBy." ".$order." ";
        }
    }
707624
public function setOrder(array $order)
    {
        // Check requirements
        if (
            in_array(self::LABEL, $order) === false ||
            in_array(self::COMPONENT, $order) === false ||
            in_array(self::MESSAGE, $order) === false
        ) {
            throw new Doozr_Form_Service_Exception(
                'Alda'
            );
        }

        $this->order = $order;
    }
532639
public function setOrder($mode, $direction = self::DIRECTION_ASC)
    {
        $this->orderMode = $mode;
        $this->orderDirection = $direction;
    }
500917
public function setOrder(\HarvestCloud\CoreBundle\Entity\Order $order = null)
    {
        $this->order = $order;

        return $this;
    }
1066819
private function clearOrderSession($order)
    {
        $this->checkoutSession->setLastOrderId($order->getId())
                              ->setLastRealOrderId($order->getIncrementId())
                              ->setLastOrderStatus($order->getStatus());
    }