Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
TestRepository.php
Go to the documentation of this file.
1 <?php
7 
10 
15 {
19  private $quoteCollectionFactory;
20 
24  private $searchResultsDataFactory;
25 
29  private $extensionAttributesJoinProcessor;
30 
36  public function __construct(
37  \Magento\Quote\Model\ResourceModel\Quote\CollectionFactory $quoteCollectionFactory,
38  \Magento\Quote\Api\Data\CartSearchResultsInterfaceFactory $searchResultsDataFactory,
39  JoinProcessorInterface $extensionAttributesJoinProcessor
40  ) {
41  $this->quoteCollectionFactory = $quoteCollectionFactory;
42  $this->searchResultsDataFactory = $searchResultsDataFactory;
43  $this->extensionAttributesJoinProcessor = $extensionAttributesJoinProcessor;
44  }
45 
49  public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria)
50  {
51  $quoteCollection = $this->quoteCollectionFactory->create();
52  $this->extensionAttributesJoinProcessor->process($quoteCollection);
53  $searchData = $this->searchResultsDataFactory->create();
54  $searchData->setSearchCriteria($searchCriteria);
55  $searchData->setItems($quoteCollection->getItems());
56  return $searchData;
57  }
58 }
__construct(\Magento\Quote\Model\ResourceModel\Quote\CollectionFactory $quoteCollectionFactory, \Magento\Quote\Api\Data\CartSearchResultsInterfaceFactory $searchResultsDataFactory, JoinProcessorInterface $extensionAttributesJoinProcessor)
$searchCriteria
$quoteCollection
getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria)