Get order coupons for a given order

@param $orderID
@param array $filter
@return mixed
355951
public static function getOrderCoupons($orderID, $filter = array())
    {
        $filter = Filter::create($filter);
        return self::getCollection('/orders/' . $orderID . '/coupons' . $filter->toQuery(), 'OrderCoupons');
    }
676090
public function listForId($orderId, array $parameters = [])
    {
        $this->parentId = $orderId;

        return parent::rest_list(null, null, $parameters);
    }
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);
    }
878221
public function findOneByOrderIdNotFinished($orderId)
    {
        $qb = $this->createQueryBuilder('p');
        $qb->select('p')
            ->where('p.orderId = :orderId')
            ->andWhere('p.finished is NULL')
            ->setParameter('orderId', strtoupper($orderId))
            ;

        return $qb->getQuery()->getOneOrNullResult();
    }
716724
public function getRecords($filter = '', $order = ['.id'], $page = 1, $count = null, $dataDimensions = null)
    {
        if ($dataDimensions == null) {
            $dataDimensions = $this->getCurrentDataDimensions();
        }

        if (!is_array($order))
        {
            $order = [$order];
        }

        if ($this->readConnection instanceof FilteringConnection) {
            $records = $this->readConnection->getRecords($this->getCurrentContentTypeName(), $dataDimensions, $filter,
                $page, $count, $order);
        } else {

            $records = $this->getAllRecords($dataDimensions);

            if ($filter != '') {
                $records = RecordsFilter::filterRecords($records, $filter);
            }

            $records = RecordsSorter::orderRecords($records, $order);

            if ($count != null) {
                $records = RecordsPager::sliceRecords($records, $page, $count);
            }
        }

        foreach ($records as $record) {
            $record->setRepository($this);
        }

        return $records;
    }
196563
public static function get_records($filters = array(), $sort = '', $order = 'ASC', $skip = 0, $limit = 0) {
        global $DB;

        $orderby = '';
        if (!empty($sort)) {
            $orderby = $sort . ' ' . $order;
        }

        $records = $DB->get_records(static::TABLE, $filters, $orderby, '*', $skip, $limit);
        $instances = array();

        foreach ($records as $record) {
            $newrecord = new static(0, $record);
            array_push($instances, $newrecord);
        }
        return $instances;
    }
1222369
public function getWithdrawals($orderid) {

		$data = array(
			'OrderID' => $orderid,
		);

		$request = new Trustly_Data_JSONRPCRequest('getWithdrawals', $data);
		return $this->call($request);
	}
1240160
public function getConditionToUpdateInputAjaxAction($couponId, $conditionIndex)
    {
        if (null !== $response = $this->checkAuth(AdminResources::COUPON, [], AccessManager::VIEW)) {
            return $response;
        }

        $this->checkXmlHttpRequest();

        $search = CouponQuery::create();
        /** @var Coupon $coupon */
        $coupon = $search->findOneById($couponId);
        if (!$coupon) {
            return $this->pageNotFound();
        }

        /** @var CouponFactory $couponFactory */
        $couponFactory = $this->container->get('thelia.coupon.factory');
        $couponManager = $couponFactory->buildCouponFromModel($coupon);

        if (!$couponManager instanceof CouponInterface) {
            return $this->pageNotFound();
        }

        $conditions = $couponManager->getConditions();
        if (!isset($conditions[$conditionIndex])) {
            return $this->pageNotFound();
        }
        /** @var ConditionInterface $condition */
        $condition = $conditions[$conditionIndex];

        /** @var ConditionFactory $conditionFactory */
        $conditionFactory = $this->container->get('thelia.condition.factory');
        $inputs = $conditionFactory->getInputsFromConditionInterface($condition);

        if ($inputs === null) {
            return $this->pageNotFound();
        }

        return $this->render(
            'coupon/condition-input-ajax',
            [
                'inputsDrawn' => $condition->drawBackOfficeInputs(),
                'conditionServiceId' => $condition->getServiceId(),
                'conditionIndex' => $conditionIndex,
            ]
        );
    }
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;
    }
405475
public function searchByClosure(\Closure $filterClosure, \Closure $orderClosure = null)
	{
		$result = array();
		
		foreach ($this->array as $item) {
			if ($filterClosure($item)) {
				$result[] = $item;
			}
		}
		
		if ( ! \is_null($orderClosure)) {
			usort($result, $orderClosure);
		}
		
		return $result;
	}
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;
    }
1171408
public function findAllByLocale($locale, $filter = array())
    {
        if (empty($filter)) {
            $order = $this->orderRepository->findAllByLocale($locale);
        } else {
            $order = $this->orderRepository->findByLocaleAndFilter($locale, $filter);
        }

        if ($order) {
            array_walk(
                $order,
                function (&$order) use ($locale) {
                    $order = $this->orderFactory->createApiEntity($order, $locale);
                    $this->updateApiEntity($order, $locale);
                }
            );
        }

        return $order;
    }
1050943
public function getDocuments($orderId, $locale)
    {
        $documents = array();
        /** @var SalesDependencyClassInterface $dependency */
        foreach ($this->dependencyClasses as $dependency) {
            // add to documents array
            $documents = array_merge($documents, $dependency->getDocuments($orderId, $locale));
        }

        return $documents;
    }
29230
public function get($order_id)
    {
        $result = null;
        $this->hook->attach('order.get.before', $order_id, $result, $this);

        if (isset($result)) {
            return $result;
        }

        $conditions = array(
            'limit' => array(0, 1),
            'order_id' => $order_id
        );

        $list = (array) $this->getList($conditions);
        $result = empty($list) ? array() : reset($list);

        $this->setCart($result);
        $this->hook->attach('order.get.after', $order_id, $result, $this);
        return $result;
    }
396366
public function get($orderId, array $params = array())
    {
        $endpoint = '/admin/orders/'.$orderId.'.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createObject(Order::class, $response['order']);
    }
53177
public function findOneBy(array $criteria, array $orderBy = null)
    {
        $qb = $this->createQueryBuilder('o');

        $this->applyCriteriaAndOrderByToQueryBuilder($qb, $criteria, $orderBy);

        return $qb->getQuery()->getOneOrNullResult();
    }
72069
public function getPurchases( DirectDebit\Purchase $purchase, DirectDebit\Filter $filter )
    {
        $queryStr = array();
        if ($purchase && $purchase->merchantRefNum)
        {
            $queryStr['merchantRefNum'] = $purchase->merchantRefNum;
        }
        if ($filter)
        {
            if (isset($filter->limit))
            {
                $queryStr['limit'] = $filter->limit;
            }
            if (isset($filter->offset))
            {
                $queryStr['offset'] = $filter->offset;
            }
            if (isset($filter->startDate))
            {
                $queryStr['startDate'] = $filter->startDate;
            }
            if (isset($filter->endDate))
            {
                $queryStr['endDate'] = $filter->endDate;
            }
        }

        $request = new Request(array(
            'method' => Request::GET,
            'uri' => $this->prepareURI($this->purchasePath . $this->uriseparator . $purchase->id),
            'queryStr' => $queryStr
        ));

        $response = $this->client->processRequest($request);
        return new DirectDebit\Pagerator($this->client, $response, '\Paysafe\DirectDebit\Purchase');
    }