Order Sorgusu oluşturur

@param string $order
@param string $type
@return \Anonym\Components\Database\Mode\Read
487158
public function order($order, $type = 'DESC')
    {

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

        return $this;
    }
828718
protected function getItemBagForOrder(Order $order)
    {
        $itemBag = $this->createItemBagForOrder($order);

        $event = new ItemBagEvent([
            'items' => $itemBag,
            'order' => $order
        ]);
        $this->trigger(self::EVENT_AFTER_CREATE_ITEM_BAG, $event);

        return $event->items;
    }
1193895
public function applyOrder($order)
    {
        switch ($order) {
            case 'time':
                $this->orderBy(['created_at' => SORT_ASC]);
                break;

            case 'supports':
            default:
                $this->orderBy(['(supports / pow((((UNIX_TIMESTAMP(NOW()) - created_at) / 3600) + 2),1.8) )' => SORT_DESC]);
                break;
        }

        return $order;
    }
196997
public function sort($key, $order)
    {
        uasort($this->db, function ($a, $b) use ($key, $order) {
            if (is_object($a) && is_object($b)) {
                return $order == 'asc'
                    ? strnatcasecmp($a->$key, $b->$key)
                    : -strnatcasecmp($a->$key, $b->$key);
            } elseif (is_array($a) && is_array($b)) {
                return $order == 'asc'
                    ? strnatcasecmp($a[$key], $b[$key])
                    : -strnatcasecmp($a[$key], $b[$key]);
            }

            throw new InvalidArgumentException('Can only sort by keys or properties of non-scalar types');
        });
    }
2310
public function byFunction(
        string $function,
        string $order
    ): SortBy {
        $this->sortsBy[] = [
            'type' => self::TYPE_FUNCTION,
            'function' => $function,
            'order' => $order,
        ];

        return $this;
    }
715873
public function setOrder($order)
    {
        if (! is_array($order)) {
            $order = func_get_args();
        }

        $this->order = $order;

        return $this;
    }
1112359
public function releaseAction(Order $order)
    {
        $order->releaseToBuyer();

        $em = $this->getDoctrine()->getEntityManager();
        $em->persist($order);
        $em->flush();

        return $this->redirect($this->generateUrl('Order_show', array(
            'id' => $order->getNumberForPath()
        )));
    }
853997
public function orderBy($field, $order = 'asc'){
        $this->model = $this->model->orderBy(...func_get_args());
        return $this;
    }
500917
public function setOrder(\HarvestCloud\CoreBundle\Entity\Order $order = null)
    {
        $this->order = $order;

        return $this;
    }
996939
public function orderByMultiple($order = ['_position' => 'ASC', '_leftnode' => 'ASC'])
    {
        if (true === empty($order)) {
            $order = ['_position' => 'ASC', '_leftnode' => 'ASC'];
        }

        $this->resetDQLPart('orderBy');
        foreach ($order as $field => $sort) {
            $this->addOrderBy($field, $sort);
        }

        return $this;
    }
551352
public function getAllSortByQuery($sort, $order = 'DESC')
    {
        $qb = $this->createQueryBuilder('p');
        $qb2 = $this->getEntityManager()->getRepository(PageSnapshot::class)->createQueryBuilder('pp');
        $qb->select('p', 'ps')
            ->leftJoin('p.snapshots', 'ps')
            ->where($qb->expr()->eq(
                'ps.id',
                '('.$qb2->select('MAX(pp.id)')
                    ->where('p.id = pp.page')
                    ->getDQL().')'
            ))
            ->orWhere('ps.id IS NULL')
            ->orderBy('p.'.$sort,  $order);

        return $qb->getQuery();
    }
690831
public function seek($condition = array(), $order=array()){
		$where = array();
		$orderBy = array();
		foreach ($condition as $key=>$value){
			if ($value!=NULL && is_object($value) && get_class($value)==NotSet::class){
				// nuevo. el campo no está establecido
			}else{
				$where[] = sprintf("`%s` = %s", $key, $this->getColumn($key)->sqlVal($value));
			}
		}
		foreach ($order as $key=>$value){
			$orderBy[] = sprintf("`%s` %s", $key, $value);
		}
		if (count($where)>0){
			$sWhere = " WHERE ".implode(' and ', $where);
		}else{
			$sWhere = "";
		}
		if (count($orderBy)>0){
			$sOrder = " ORDER BY ".implode(',', $orderBy);
		}else{
			$sOrder = "";
		}
		$sSql = sprintf("SELECT * FROM `%s` %s %s LIMIT 0,1", $this->getTableName(), $sWhere, $sOrder);
		$rows = $this->model->getRecords($sSql);
		if (count($rows)>0){
			return $this->fromRowToModelRow($rows[0]);
		}else{
			//return NULL;
			throw new \Exception("Registro no localizado");
		}
	}
385165
public function fetchAll($order=array()) {
		$obj = $this->getConnection();
        if (empty($order) == false) {
            foreach ($order as $key => $value) {
                $obj->orderBy($key, $value);
            }
        }
        return $obj->get($this->getDao()->getTableName());
	}
686291
public function acceptAction(Order $order)
    {
        $order->acceptBySeller();

        $em = $this->getDoctrine()->getEntityManager();
        $em->persist($order);
        $em->flush();

#        $this->get('notifier')->notify(new OrderAcceptedBySellerEvent($order), $this->getUser());

        return $this->redirect($this->generateUrl('Order_show', array(
            'id' => $order->getNumberForPath()
        )));
    }
960439
public function orderBy($type = null)
    {
        if ($type === null) {
            $target = null;

        } elseif ($type instanceof RawSqlFragmentInterface) {
            $target = $type->getFragment();

        } elseif (is_array($type)) {
            // Special case for non-associative array
            if (!ArrayUtils::isAssoc($type)) {
                // Check if at least one value represents a raw fragment
                foreach ($type as &$option) {
                    // If raw, then do nothing but get it
                    if ($option instanceof RawSqlFragmentInterface) {
                        $option = $option->getFragment();
                    } else {
                        // Not raw - OK, then just quote it
                        $option = $this->quote($option);
                    }
                }
            } else {
                // If associative array supplied then assume that values represent sort orders
                $result = array();

                foreach ($type as $column => $sortOrder) {
                    // Force sorting method to be in upper case
                    $sortOrder = strtoupper($sortOrder);

                    // Ensure that only valid sorting methods provided
                    if (!in_array($sortOrder, array('ASC', 'DESC'))) {
                        throw new LogicException(sprintf(
                            'Only ASC and DESC methods are supported. You provided "%s"', $sortOrder
                        ));
                    }

                    // Only column names should be wrapped around backticks
                    array_push($result, sprintf('%s %s', $this->quote($column), $sortOrder));
                }

                $type = $result;
            }

            $target = implode(', ', $type);

        } else {
            $target = $this->quote($type);
        }

        $this->append(' ORDER BY '.$target);
        return $this;
    }
180158
public function create(Order $order)
    {
        $user = Auth::user();
        // 직접 입력은 무통장입금만 가능
        $paymentMethodId = DirectBank::getId();
        $paymentGatewayId = (new DirectPayGateway)->getId();
        // 미결상태면
        $isWaitingPayment = $order->status_id < OrderStatus::PENDING;
        return view('order::admin.transactions.create', compact('order', 'user', 'paymentMethodId', 'paymentGatewayId', 'isWaitingPayment'));
    }
439121
function order($order)
	{
		$parsed_order = array();
		foreach(explode(',', $order) as $property_name)
		{
			$property_name = trim($property_name);
			if(preg_match('/^-(.+)/', $property_name, $m))
			{
				$property_name = $m[1];
				$dir = ' DESC';
			}
			else
				$dir = '';

			$property_name = $this->first_parse($property_name);
			$property_name = $this->stack_parse($property_name);
			$property_name = $this->class_parse($property_name);

			$parsed_order[] = "$property_name$dir";
		}

		$this->_where['*raw_order'] = "ORDER BY ".join(', ', $parsed_order);

		return $this;
	}