Order ---------------------------------
428079
public function setCartToken( $model, $type ) {

		// Cookie not set or token is set for a different business
		if( !isset( $_COOKIE[ self::COOKIE_CART ] ) ) {

			$data = [ 'slug' => $model->slug, 'type' => $type, 'token' => Yii::$app->security->generateRandomString() ];

			$this->setCookie( self::COOKIE_CART, json_encode( $data ) );
		}
		else {

			$data = json_decode( $_COOKIE[ self::COOKIE_CART ], true );

			if( $type !== $data[ 'type' ] || $model->slug !== $data[ 'slug' ] ) {

				$data = [ 'slug' => $model->slug, 'type' => $type, 'token' => Yii::$app->security->generateRandomString() ];

				$this->setCookie( self::COOKIE_CART, json_encode( $data ) );
			}
		}
	}
1322337
public static function getOrder()
    {
        $cls = get_called_class();
        return array_key_exists($cls, self::$_order) ? self::$_order[$cls] : "";
    }
757710
function() {
			this.writeDebug('order',arguments);
			var _this = this,
				$mapDiv = $('#' + _this.settings.mapID),
				$orderSelect = $('#' + _this.settings.orderID);

			if ($orderSelect.length === 0) {
				return;
			}

			$orderSelect.on('change.'+pluginName, function (e) {
				e.stopPropagation();

				// Reset pagination.
				if (_this.settings.pagination === true) {
					_this.paginationChange(0);
				}

				_this.settings.sortBy.order = $(this).val();

				// Callback
				if (_this.settings.callbackOrder) {
					_this.settings.callbackOrder.call(this, _this.settings.order);
				}

				if ($mapDiv.hasClass('bh-sl-map-open')) {
					_this.mapping(mappingObj);
				}
			});
		}
222646
public function orderBy($orderBy = NULL) {
        if (isset($orderBy)) {
            $this->setOrderBy($orderBy);
            return $this;
        }
        return $this->getOrderBy();
    }
854455
public void order() {
        final OrderComparator comparator = new OrderComparator();
        for (Class<? extends FeatureInstaller> installer : installerTypes) {
            if (Ordered.class.isAssignableFrom(installer)) {
                final List<Class<?>> extensions = this.extensions.get(installer);
                if (extensions == null || extensions.size() <= 1) {
                    continue;
                }
                extensions.sort(comparator);
            }
        }
    }
350739
public function ordering()
    {
        if ($this->orderCallback) {
            return call_user_func($this->orderCallback, $this->resolveCallbackParameter());
        }

        return $this->defaultOrdering();
    }
1205129
public function orderBy() {
        $args = func_get_args();
        $this->build()->bindExpression('orderBy', $args[0] . " " . (empty($args[1]) ? ' ASC ' : " $args[1]"));

        return $this->connection;
    }
108444
def order(self, *args):
    """"""
    # q.order(Employee.name, -Employee.age)
    if not args:
      return self
    orders = []
    o = self.orders
    if o:
      orders.append(o)
    for arg in args:
      if isinstance(arg, model.Property):
        orders.append(datastore_query.PropertyOrder(arg._name, _ASC))
      elif isinstance(arg, datastore_query.Order):
        orders.append(arg)
      else:
        raise TypeError('order() expects a Property or query Order; '
                        'received %r' % arg)
    if not orders:
      orders = None
    elif len(orders) == 1:
      orders = orders[0]
    else:
      orders = datastore_query.CompositeOrder(orders)
    return self.__class__(kind=self.kind, ancestor=self.ancestor,
                          filters=self.filters, orders=orders,
                          app=self.app, namespace=self.namespace,
                          default_options=self.default_options,
                          projection=self.projection, group_by=self.group_by)
932949
@Override
    public void orderRows(final OrderBy ob) {
        if (ob != null) {
            ob.setMetaData(getMetaData());
            ob.setParser(parser);
            Collections.sort(rows, ob);
            goTop();
        }
    }
1087522
protected function enforceOrderBy()
    {
        if (empty($this->query->orders) && empty($this->query->unionOrders)) {
            $this->orderBy($this->model->getQualifiedKeyName(), 'asc');
        }
    }
1218207
private function order()
    {
        if ($this->startDate > $this->endDate) {
            $tmp = clone $this->startDate;
            $this->startDate = clone $this->endDate;
            $this->endDate = clone $tmp;
            unset($tmp);
        }

        return $this;
    }
1344813
protected function orderFixturesByNumber()
    {
        $this->orderedFixtures = $this->fixtures;
        usort(
            $this->orderedFixtures,
            function ($a, $b) {
                if ($a instanceof OrderedFixtureInterface && $b instanceof OrderedFixtureInterface) {
                    if ($a->getOrder() === $b->getOrder()) {
                        return 0;
                    }

                    return $a->getOrder() < $b->getOrder() ? -1 : 1;
                } elseif ($a instanceof OrderedFixtureInterface) {
                    return $a->getOrder() === 0 ? 0 : 1;
                } elseif ($b instanceof OrderedFixtureInterface) {
                    return $b->getOrder() === 0 ? 0 : -1;
                }

                return 0;
            }
        );
    }
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." ";
        }
    }
959096
public List<E> order() {
		int index = 0;
		for (E item : input) {
			index = output.indexOf(item);
			if (index == -1) {
				insert(item, item);
			}
		}

		return output;
	}
1139154
protected function sortColumns()
    {
        $this->config->getColumns()->sort(function (FieldConfig $a, FieldConfig $b) {
            return $a->getOrder() > $b->getOrder();
        });
    }
405609
public function addOrderBy($_)
    {
        RecursiveArgs::each(func_get_args(), function ($arg) {
            $this->orderByClauses[] = $arg;
        });

        return $this;
    }
701679
public function setOrder()
    {
        // set order position if exist
        $order = [];
        foreach ($this->data['order'] as $alias => $params) {

            $order = array_flip($order);

            if (empty($params) === false) {

                foreach ($params as $field => $sort) {
                    $order[] = $alias . '.' . $field . ' ' . $sort;
                }
            }
        }

        $this->builder->orderBy($order);

        return null;
    }