returns all possible workflows for the current entity

@param Order $order
@return array
966313
public function getWorkflows($order)
    {
        $workflows = array();
        $actions = array(
            'confirm' => array(
                'section' => $this->getName(),
                'title' => 'salesorder.orders.confirm',
                'event' => 'sulu.salesorder.order.confirm.clicked'
            ),
            'edit' => array(
                'section' => $this->getName(),
                'title' => 'salesorder.orders.edit',
                'event' => 'sulu.salesorder.order.edit.clicked'
            ),
            'delete' => array(
                'section' => $this->getName(),
                'title' => 'salesorder.orders.delete',
                'event' => 'sulu.salesorder.order.delete',
                'parameters'=> array('id'=> $order->getId())
            ),
        );

        // define workflows by order's status
        $orderStatusId = $order->getStatus()->getId();
        // order is in created state
        if ($orderStatusId === OrderStatus::STATUS_CREATED) {
            $workflows[] = $actions['confirm'];
        }
        // order is confirmed
        else if ($orderStatusId === OrderStatus::STATUS_CONFIRMED) {
            $workflows[] = $actions['edit'];
        }

        // order is allowed to be deleted
        if ($this->allowDelete($order)) {
            $workflows[] = $actions['delete'];
        }

        // get workflows from dependencies
        /** @var SalesDependencyClassInterface $dependency */
        foreach ($this->dependencyClasses as $dependency) {
            $workflows = array_merge($workflows, $dependency->getWorkflows($order));
        }
        return $workflows;
    }
67562
public function getOrderInformation(): array
    {
        return [
            'amount' => (int) $this->xml->OrderInformation->Amount,
            'currency' => (string) $this->xml->OrderInformation->Currency,
            'orderNumber' => (string) $this->xml->OrderInformation->OrderNumber,
            'orderDescription' => (string) $this->xml->OrderInformation->OrderDescription,
            'fee' => (int) $this->xml->OrderInformation->Fee,
            'roundingAmount' => (int) $this->xml->OrderInformation->RoundingAmount,
            'total' => (int) $this->xml->OrderInformation->Total,
            'timestamp' => (string) $this->xml->OrderInformation->Timestamp,
        ];
    }
689063
public function getList($orderId)
    {
        $db = $this->getDb();
        $data = $db->getAll('SELECT * FROM `oepaypal_orderpayments` WHERE `oepaypal_orderid` = ' . $db->quote($orderId) . ' ORDER BY `oepaypal_date` DESC');

        return $data;
    }
543538
public function receiveAction(Order $order)
    {
        $order->receiveByHub();

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

        return $this->redirect($this->generateUrl('Order_show', array(
            'id' => $order->getNumberForPath()
        )));
    }
963776
public function getItems($order = null)
    {
        if (null === $order) {
            return $this->items;
        }

        return $this->sort($this->items, $order);
    }
1076305
private function formatTransactionData($order, $transaction, $amount)
    {
        return [
            'Time' => $this->timezone->formatDateTime(
                date('Y-m-d H:i:s', $transaction->date / 1000),
                2,
                2
            ),
            'Reference' => $transaction->reference,
            'Amount' => $order->getBaseCurrency()->formatTxt($amount / 100),
            'Transaction ID' => $transaction->id
        ];
    }
328718
public function searchRepositories(string $q, string $sort = null,
                                       string $order = AbstractApi::DIRECTION_DESC): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/search/repositories?:args',
            http_build_query(['q' => $q, 'sort' => $sort, 'order' => $order])));
    }
1183092
public function findAllPersonalWorkspaces($orderedBy = 'name', $order = 'ASC')
    {
        $dql = "
            SELECT w
            FROM Claroline\CoreBundle\Entity\Workspace\Workspace w
            WHERE EXISTS (
                SELECT u
                FROM Claroline\CoreBundle\Entity\User u
                JOIN u.personalWorkspace pw
                WHERE pw = w
            )
            ORDER BY w.{$orderedBy} {$order}
        ";
        $query = $this->_em->createQuery($dql);

        return $query->getResult();
    }
432655
public function all($order = 'ASC')
    {
        $capsule = $this->_database->getCapsule();

        $this->_model = $capsule->table($this->table)->orderBy('id', $order)->get();

        return $this->_model;
    }
1026617
public function show(Order $order)
    {
        Shop::instance($order->shop_id);
        $paymentMethods = Shop::getPaymentMethods()->flatten()->mapWithKeys(function($method) {
            return [$method::getId() => $method::getName()];
        })->all();
        $orderStatuses = $this->orderstatus->all()->pluck('name', 'id')->toArray();

        return view('order::admin.orders.view', compact('order', 'paymentMethods', 'orderStatuses'));
    }
1042846
public function orderBy($order = null) {
		if (is_null($order)) //remove option
			return $this->discard('query.orderBy');
			
		return $this->merge(['query.orderBy' => func_get_args()]);
	}
129128
public function createdToCustomer($order)
    {
        $store = $this->store->get($order['store_id']);
        $url = $this->store->getUrl($store);
        $user = $this->user->get($order['user_id']);
        $store_name = $this->store->getTranslation('title', $this->translation->getLangcode(), $store);

        $options = $this->store->getConfig(null, $store);
        $options['from'] = reset($store['data']['email']);

        $vars = array(
            '@store' => $store_name,
            '@order_id' => $order['order_id'],
            '@order' => "$url/account/{$order['user_id']}",
            '@status' => $this->order->getStatusName($order['status']),
        );

        $subject = $this->translation->text('Order #@order_id on @store', $vars);
        $message = $this->translation->text("Thank you for ordering on @store\r\n\r\nOrder ID: @order_id\r\nOrder status: @status\r\nView orders: @order", $vars);
        $message .= $this->getSignature($options);

        return array($user['email'], $subject, $message, $options);
    }
206300
private function getCostCollection(OrderInterface $order) : Collection
    {
        if ($order->hasShippingMethod()) {
            $costs = $this->getCurrentShippingMethodCostsCollection($order);
            if ($costs->count() > 0) {
                return $costs;
            }
        }
        
        return $this->getShippingCostCollection($order);
    }
426827
protected function getFormParameters(OrderInterface $order)
    {
        return [
            'PSPID' => $this->getOption('pspid'),
            'orderId' => $order->getReference(),
            'amount' => $order->getTotalInc() * 100,
            'currency' => $order->getCurrency()->getLabel(),
            'language' => $order->getLocale(),
            'CN' => $order->getBillingName(),
            'EMAIL' => $order->getBillingEmail(),
            'ownerZIP' => $order->getBillingPostcode(),
            'owneraddress' => $this->getAddress($order),
            'ownercty' => $order->getBillingCity(),
            'ownertelno' => $order->getBillingPhone() ?: $order->getBillingMobile(),

            'homeurl' => $this->getOption('home_url'),
            'catalogurl' => $this->getOption('catalog_url'),

            'COMPLUS' => '',
            'PARAMPLUS' => 'bank='.$this->getCode(),
            'PARAMVAR' => '',

            'PM' => 'CreditCard',
            'WIN3DS' => 'MAINW',
            'PMLIST' => 'VISA;MasterCard;CB',
            'PMListType' => 2,

            'accepturl' => $this->generateAbsoluteUrlFromOption('url_callback', $order),
            'declineurl' => $this->generateAbsoluteUrlFromOption('url_callback', $order),
            'exceptionurl' => $this->generateAbsoluteUrlFromOption('url_return_ko', $order),
            'cancelurl' => $this->generateAbsoluteUrlFromOption('url_return_ko', $order),

            'operation' => $this->getOperation(),
        ];
    }
1083440
protected function canViewOrder(Order $order)
    {
        return $this->httpContext->getValue(Context::CONTEXT_AUTH)
            && $this->isVisible($order);
    }
155403
public function orderItems(Order $order)
    {
        return response()->json([
            'errors' => false,
            'data' => $order->items->map(function($item) {
                $item->product->load('options');
                return $item;
            }),
        ]);
    }
937288
public function parseOrderByField($order)
	{
		if(isset($order[0],$order[1]))
		{
			if(!is_array($order[1]))
			{
				$order[1] = explode(',', $order[1]);
			}
			$list = array();
			foreach($order[1] as $item)
			{
				$paramName = $this->getParamName();
				$this->operationOption['params'][$paramName] = $item;
				$list[] = ':' . $paramName;
			}
			return 'field(' . $this->parseKeyword($order[0]) . ',' . implode(',', $list) . ')';
		}
		else
		{
			return 1;
		}
	}