add an order clause
489214
public function orderBy(array $columns_and_direction) {
		// for each given parameter
		foreach($columns_and_direction as $column => $direction) {
			// if the direction is not valid force ASC
			$direction == 'ASC' || $direction == 'DESC' ?: $direction = 'ASC';
			// secure the column name
			list($column) = Query\Convert::columnToPlaceholder($this->Quote ,$column);
			// push it
			$this->Order[] = "{$column} $direction";
		}
		// return self to the next method
		return $this;
	}
306850
protected function addOrdering()
    {
        if ($this->parser->getOrder()) {
            $this->query->orderByRaw($this->parser->getOrder());
        }

        return $this;
    }
798396
public void addOrder(String columnName, boolean ascending) {
    if (columnName == null) {
      return;
    }
    for (int i = 0; i < columns.size(); i++) {
      if (!columnName.equals(columns.get(i).getData())) {
        continue;
      }
      order.add(new Order(i, ascending ? "asc" : "desc"));
    }
  }
1098076
public AnimaQuery<T> order(String order) {
        if (this.orderBySQL.length() > 0) {
            this.orderBySQL.append(',');
        }
        this.orderBySQL.append(' ').append(order);
        return this;
    }
791568
public OqlBuilder<T> orderBy(final int index, final String orderBy) {
    if (null != orders) {
      if (isNotEmpty(statement)) { throw new RuntimeException("cannot add order by to a exists statement."); }
      this.orders.addAll(index, Order.parse(orderBy));
    }
    return this;
  }
315761
def order(self, order):
    '''

    '''
    order = order if isinstance(order, Order) else Order(order)

    # ensure order gets attr values the same way the rest of the query does.
    order.object_getattr = self.object_getattr
    self.orders.append(order)
    return self
750634
public function addOrderBy($sort, $order = null)
    {
        return $this->add('orderBy', $sort . ' ' . (! $order ? 'ASC' : $order), true);
    }
224521
private void _buildOrderClause(
                    final List<Order> orders,
                    final StringBuilder stmt
                    )
    {
        int  n_orders = (orders == null ? 0 : orders.size());
        if (n_orders == 0) {
            return;
        }

        stmt.append( _ORDER_BY_ );
        for (int  i = 0; i < n_orders; i++) {
            if (i > 0) {
                stmt.append( "," );
            }

            final Order  order = orders.get( i );
            _buildProperty( order.getProperty(), stmt );
            //throws SearchException

            if (order.isDescending()) {
                stmt.append( _DESC_ );
            }
        }
    }
1240673
def placeOrder(self, contract: Contract, order: Order) -> Trade:
        
        orderId = order.orderId or self.client.getReqId()
        self.client.placeOrder(orderId, contract, order)
        now = datetime.datetime.now(datetime.timezone.utc)
        key = self.wrapper.orderKey(
            self.wrapper.clientId, orderId, order.permId)
        trade = self.wrapper.trades.get(key)
        if trade:
            # this is a modification of an existing order
            assert trade.orderStatus.status not in OrderStatus.DoneStates
            logEntry = TradeLogEntry(now, trade.orderStatus.status, 'Modify')
            trade.log.append(logEntry)
            self._logger.info(f'placeOrder: Modify order {trade}')
            trade.modifyEvent.emit(trade)
            self.orderModifyEvent.emit(trade)
        else:
            # this is a new order
            order.clientId = self.wrapper.clientId
            order.orderId = orderId
            orderStatus = OrderStatus(status=OrderStatus.PendingSubmit)
            logEntry = TradeLogEntry(now, orderStatus.status, '')
            trade = Trade(
                contract, order, orderStatus, [], [logEntry])
            self.wrapper.trades[key] = trade
            self._logger.info(f'placeOrder: New order {trade}')
            self.newOrderEvent.emit(trade)
        return trade
644801
private static void addOrder(PersistentEntity entity,
                                 CriteriaQuery query,
                                 From queryRoot,
                                 CriteriaBuilder criteriaBuilder,
                                 String sort, String order, boolean ignoreCase) {
        if (sort.equalsIgnoreCase(entity.getIdentity().getName())) {
            Expression path = queryRoot;

            if (ignoreCase) {
                path = criteriaBuilder.upper(path);
            }
            if (DynamicFinder.ORDER_DESC.equals(order)) {
                query.orderBy(criteriaBuilder.desc(path));
            } else {
                query.orderBy(criteriaBuilder.asc(path));
            }
        } else {
            Expression path = queryRoot.get(sort);

            if (ignoreCase) {
                path = criteriaBuilder.upper(path);
            }
            if (DynamicFinder.ORDER_DESC.equals(order)) {
                query.orderBy(criteriaBuilder.desc(path));
            } else {
                query.orderBy(criteriaBuilder.asc(path));
            }
        }
    }
1270719
protected function addOrderBy()
    {
        if (static::$versionTransformer->isOrdered()) {
            foreach (static::$versionTransformer->getOrderedColumns() as $index => $direction) {
                if (isset($this->columnNames[$index])) {
                    $this->builder->orderBy(
                        $this->columnNames[$index],
                        $direction
                    );
                }
            }
        }
    }
983029
def placeOrder(self, id, contract, order):
        """"""
        return _swigibpy.EClientSocketBase_placeOrder(self, id, contract, order)
107723
def add_clause(self, clause, no_return=True):
        

        if self.minicard:
            res = pysolvers.minicard_add_cl(self.minicard, clause)

            if res == False:
                self.status = False

            if not no_return:
                return res
308989
def create_order(self, order_deets):
        """"""
        request = self._post('transactions/orders', order_deets)
        return self.responder(request)
168716
def _get_order_clause(archive_table):
    
    order_clause = [
        sa.asc(getattr(archive_table, col_name)) for col_name in archive_table._version_col_names
    ]
    order_clause.append(sa.asc(archive_table.version_id))
    return order_clause
278042
public static <T> void appendOrder(OrderBy<T> orderBy, String orderByClause) {

        if (orderByClause == null) {
            return;
        }

        String[] chunks = orderByClause.split(",");
        for (String chunk : chunks) {
            String[] pairs = chunk.split(" ");
            Property p = parseOrderProperty(pairs);
            if (p != null) {
                orderBy.add(p);
            }
        }
    }
395162
private function _addShipmentsToOrder()
    {
        for ($i=1; $i<=$this->queryStringParams["totalShipments"];$i++) {
            $this->exampleClass->addShipmentToOrder(
                $this->queryStringParams["item".$i]
            );
        }
    }