Load the email order by quote id.

@param int $orderId
@param int $quoteId

@return boolean|\Dotdigitalgroup\Email\Model\Order
485107
public function loadByOrderIdAndQuoteId($orderId, $quoteId)
    {
        $collection = $this->addFieldToFilter('order_id', $orderId)
            ->addFieldToFilter('quote_id', $quoteId)
            ->setPageSize(1);

        if ($collection->getSize()) {
            return $collection->getFirstItem();
        }

        return false;
    }
835506
public function getClientId($orderIndex = 0)
    {
        $bindingInfo = $this->getBindingInfo($orderIndex);
        return array_key_exists('clientId', $bindingInfo) ? $bindingInfo['clientId'] : null;
    }
1123466
public function getOrder($orderId)
    {
        $result = $this->wechat->httpRaw(self::WECHAT_ORDER_GET_PREFIX, [
            'order_id' => $orderId
        ], [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'success' ? $result['order'] : false;
    }
513766
public static function getShipments($orderID, $filter = array())
    {
        $filter = Filter::create($filter);
        return self::getCollection('/orders/' . $orderID . '/shipments' . $filter->toQuery(), 'Shipment');
    }
936670
public function load($orderId)
    {
        $db = $this->getDb();
        $data = $db->getRow('SELECT * FROM `oepaypal_order` WHERE `oepaypal_orderid` = ' . $db->quote($orderId));

        return $data;
    }
633510
public function load($orderId)
    {
        $this->setOrderId($orderId);

        $payments = array();
        $paymentsData = $this->getDbGateway()->getList($this->getOrderId());
        if (is_array($paymentsData) && count($paymentsData)) {
            $payments = array();
            foreach ($paymentsData as $data) {
                $payment = oxNew(\OxidEsales\PayPalModule\Model\OrderPayment::class);
                $payment->setData($data);
                $payments[] = $payment;
            }
        }

        $this->setArray($payments);
    }
1111659
public function hasOrder($orderId)
    {
        $orderIdList = $this->session->get(self::SESSIONNAME, array());

        return true === in_array($orderId, $orderIdList);
    }
1316772
public function loadOrderShippingMethod(
        CartInterface $cart,
        OrderInterface $order
    ) {
        $shippingMethodId = $cart->getShippingMethod();

        if (empty($shippingMethodId)) {
            return $this;
        }

        $shippingMethod = $this
            ->shippingWrapper
            ->getOneById($cart, $shippingMethodId);

        if ($shippingMethod instanceof ShippingMethod) {
            $order->setShippingAmount($shippingMethod->getPrice());
            $order->setShippingMethod($shippingMethod);
        }
    }
281691
public function delete($orderId)
    {
        $db = $this->getDb();
        $db->startTransaction();

        $deleteCommentsResult = $db->execute(
            'DELETE
                `oepaypal_orderpaymentcomments`
            FROM `oepaypal_orderpaymentcomments`
                INNER JOIN `oepaypal_orderpayments` ON `oepaypal_orderpayments`.`oepaypal_paymentid` = `oepaypal_orderpaymentcomments`.`oepaypal_paymentid`
            WHERE `oepaypal_orderpayments`.`oepaypal_orderid` = ' . $db->quote($orderId)
        );
        $deleteOrderPaymentResult = $db->execute('DELETE FROM `oepaypal_orderpayments` WHERE `oepaypal_orderid` = ' . $db->quote($orderId));
        $deleteOrderResult = $db->execute('DELETE FROM `oepaypal_order` WHERE `oepaypal_orderid` = ' . $db->quote($orderId));

        $result = ($deleteOrderResult !== false) || ($deleteOrderPaymentResult !== false) || ($deleteCommentsResult !== false);

        if ($result) {
            $db->commitTransaction();
        } else {
            $db->rollbackTransaction();
        }

        return $result;
    }
615893
public function setTemplateId($id, $order = null) {
        if ($order === null) {
            // If no order is provided, append the template ID to the end of the list
            $this->template_ids[] = $id;
        } else {
            $this->template_ids[$order] = $id;
        }
        return $this;
    }
569007
public function loadByTransactionId($transactionId)
    {
        $db = $this->getDb();
        $data = $db->getRow('SELECT * FROM `oepaypal_orderpayments` WHERE `oepaypal_transactionid` = ' . $db->quote($transactionId));

        return $data;
    }
557694
protected function getOrder($orderId)
    {
        if (null == $order = OrderQuery::create()->findPk($orderId)) {
            $this->getLog()->addError(
                $this->getTranslator()->trans("Unknown order ID:  %id", array('%id' => $orderId))
            );
        }

        return $order;
    }
1017099
public function getOrderDetails($orderId)
    {
        if (is_null($orderId) || $orderId == '') {
            throw new Exception('The orderId is required to get the details or an order.');
        }

        $params = array(
            'method' => 'sp.order.get_details',
            'order_id' => $orderId
        );

        return $this->_makeApiRequest($params);
    }
1013358
public function loadById($productId)
    {
        return $this->productRepository->getById($productId, false, $this->storeManager->getStore()->getId(), true);
    }
285243
public function getEmailOrderRow($orderId, $quoteId, $storeId)
    {
        $collection = $this->addFieldToFilter('order_id', $orderId)
            ->addFieldToFilter('quote_id', $quoteId)
            ->addFieldToFilter('store_id', $storeId)
            ->setPageSize(1);

        if ($collection->getSize()) {
            return $collection->getFirstItem();
        }

        return false;
    }
465210
public function confirmPayment($orderId)
    {
        try {
            $orderId = \intval($orderId);

            if (null !== $order = $this->getOrder($orderId)) {
                $this->getLog()->addInfo(
                    $this->getTranslator()->trans(
                        "Processing confirmation of order ref. %ref, ID %id",
                        array('%ref' => $order->getRef(), '%id' => $order->getId())
                    )
                );

                $event = new OrderEvent($order);

                $event->setStatus(OrderStatusQuery::getPaidStatus()->getId());

                $this->dispatch(TheliaEvents::ORDER_UPDATE_STATUS, $event);

                $this->getLog()->addInfo(
                    $this->getTranslator()->trans(
                        "Order ref. %ref, ID %id has been successfully paid.",
                        array('%ref' => $order->getRef(), '%id' => $order->getId())
                    )
                );
            }
        } catch (\Exception $ex) {
            $this->getLog()->addError(
                $this->getTranslator()->trans(
                    "Error occured while processing order ref. %ref, ID %id: %err",
                    array(
                        '%err' => $ex->getMessage(),
                        '%ref' => !isset($order) ? "?" : $order->getRef(),
                        '%id' => !isset($order) ? "?" : $order->getId()
                    )
                )
            );

            throw $ex;
        }
    }
250685
public function createPaymentById($orderId)
    {
        $query = $this->getFactory()->createPaymentPayoneQuery();
        $query->findByFkSalesOrder($orderId);

        return $query;
    }