Esempio n. 1
0
 /**
  * Lists order payments that match specified search criteria.
  *
  * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria.
  * @return \Magento\Sales\Api\Data\OrderPaymentSearchResultInterface Order payment search result interface.
  */
 public function getList(\Magento\Framework\Api\SearchCriteria $criteria)
 {
     /** @var \Magento\Sales\Model\ResourceModel\Order\Payment\Collection $collection */
     $collection = $this->searchResultFactory->create();
     foreach ($criteria->getFilterGroups() as $filterGroup) {
         foreach ($filterGroup->getFilters() as $filter) {
             $condition = $filter->getConditionType() ? $filter->getConditionType() : 'eq';
             $collection->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]);
         }
     }
     $collection->setCurPage($criteria->getCurrentPage());
     $collection->setPageSize($criteria->getPageSize());
     return $collection;
 }
 /**
  * Find order addresses by criteria.
  *
  * @param \Magento\Framework\Api\SearchCriteria  $criteria
  * @return \Magento\Sales\Api\Data\OrderAddressInterface[]
  */
 public function getList(\Magento\Framework\Api\SearchCriteria $criteria)
 {
     //@TODO: fix search logic
     /** @var \Magento\Sales\Api\Data\OrderAddressSearchResultInterface $searchResult */
     $searchResult = $this->searchResultFactory->create();
     foreach ($criteria->getFilterGroups() as $filterGroup) {
         foreach ($filterGroup->getFilters() as $filter) {
             $condition = $filter->getConditionType() ? $filter->getConditionType() : 'eq';
             $searchResult->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]);
         }
     }
     $searchResult->setCurPage($criteria->getCurrentPage());
     $searchResult->setPageSize($criteria->getPageSize());
     return $searchResult;
 }
Esempio n. 3
0
 /**
  * Find entities by criteria
  *
  * @param \Magento\Framework\Api\SearchCriteria $searchCriteria
  * @return \Magento\Sales\Api\Data\ShipmentItemInterface[]
  */
 public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria)
 {
     $collection = $this->shipmentItemInterfaceSearchResultFactory->create();
     $this->extensionAttributesJoinProcessor->process($collection);
     foreach ($searchCriteria->getFilterGroups() as $filterGroup) {
         foreach ($filterGroup->getFilters() as $filter) {
             $condition = $filter->getConditionType() ? $filter->getConditionType() : 'eq';
             $collection->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]);
         }
     }
     $collection->setCurPage($searchCriteria->getCurrentPage());
     $collection->setPageSize($searchCriteria->getPageSize());
     return $collection;
 }
Esempio n. 4
0
 /**
  * {@inheritdoc}
  */
 public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria)
 {
     /** @var TransactionResource\Collection $collection */
     $collection = $this->searchResultFactory->create();
     foreach ($searchCriteria->getFilterGroups() as $filterGroup) {
         foreach ($filterGroup->getFilters() as $filter) {
             $condition = $filter->getConditionType() ? $filter->getConditionType() : 'eq';
             $collection->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]);
         }
     }
     $collection->setCurPage($searchCriteria->getCurrentPage());
     $collection->setPageSize($searchCriteria->getPageSize());
     $collection->addPaymentInformation(['method']);
     $collection->addOrderInformation(['increment_id']);
     return $collection;
 }
Esempio n. 5
0
 /**
  * Find entities by criteria
  *
  * @param \Magento\Framework\Api\SearchCriteria  $criteria
  * @return Transaction[]
  */
 public function find(\Magento\Framework\Api\SearchCriteria $criteria)
 {
     /** @var TransactionResource\Collection $collection */
     $collection = $this->transactionCollectionFactory->create();
     foreach ($criteria->getFilterGroups() as $filterGroup) {
         foreach ($filterGroup->getFilters() as $filter) {
             $condition = $filter->getConditionType() ? $filter->getConditionType() : 'eq';
             $collection->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]);
         }
     }
     $collection->setCurPage($criteria->getCurrentPage());
     $collection->setPageSize($criteria->getPageSize());
     $collection->addPaymentInformation(['method']);
     $collection->addOrderInformation(['increment_id']);
     foreach ($collection as $object) {
         $this->register($object);
     }
     $objectIds = $collection->getAllIds();
     return array_intersect_key($this->registry, array_flip($objectIds));
 }