1 | <?php |
||
30 | class PurchasedItemsAttachmentProvider implements PurchasedItemsAttachmentProviderInterface |
||
31 | { |
||
32 | /** |
||
33 | * @var \LizardMedia\ProductAttachment\Model\ResourceModel\Attachment\CollectionFactory |
||
34 | */ |
||
35 | private $collectionFactory; |
||
36 | |||
37 | |||
38 | /** |
||
39 | * @var \Magento\Framework\Api\SearchCriteriaBuilder |
||
40 | */ |
||
41 | private $searchCriteriaBuilder; |
||
42 | |||
43 | |||
44 | /** |
||
45 | * @var \Magento\Sales\Api\OrderItemRepositoryInterface |
||
46 | */ |
||
47 | private $orderItemRepository; |
||
48 | |||
49 | |||
50 | /** |
||
51 | * @var \Magento\Sales\Api\OrderRepositoryInterface |
||
52 | */ |
||
53 | private $orderRepository; |
||
54 | |||
55 | |||
56 | /** |
||
57 | * @var \Magento\Store\Model\StoreManagerInterface |
||
58 | */ |
||
59 | private $storeManager; |
||
60 | |||
61 | |||
62 | /** |
||
63 | * @param \LizardMedia\ProductAttachment\Model\ResourceModel\Attachment\CollectionFactory $collectionFactory |
||
64 | * @param \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder |
||
65 | * @param \Magento\Sales\Api\OrderItemRepositoryInterface $orderItemRepository |
||
66 | * @param \Magento\Sales\Api\OrderRepositoryInterface $orderRepository |
||
67 | * @param \Magento\Store\Model\StoreManagerInterface $storeManager |
||
68 | */ |
||
69 | public function __construct( |
||
82 | |||
83 | |||
84 | /** |
||
85 | * |
||
86 | * @param \Magento\Customer\Api\Data\CustomerInterface $customer |
||
87 | * |
||
88 | * @throws \Exception |
||
89 | * |
||
90 | * @return mixed \LizardMedia\ProductAttachment\Model\ResourceModel\Attachment\Collection | null |
||
91 | */ |
||
92 | public function get(CustomerInterface $customer) : Collection |
||
118 | |||
119 | |||
120 | /** |
||
121 | * @param \Magento\Customer\Api\Data\CustomerInterface $customer |
||
122 | * |
||
123 | * @return \Magento\Sales\Api\Data\OrderInterface[] |
||
124 | */ |
||
125 | private function getCustomerOrders(CustomerInterface $customer) : array |
||
135 | |||
136 | |||
137 | /** |
||
138 | * @param \Magento\Customer\Api\Data\CustomerInterface $customer |
||
139 | * |
||
140 | * @return \Magento\Framework\Api\SearchCriteriaInterface |
||
141 | */ |
||
142 | private function prepareCustomerOrdersSearchCriteria(CustomerInterface $customer) : SearchCriteriaInterface |
||
147 | |||
148 | |||
149 | /** |
||
150 | * @param array $orderIds |
||
151 | * |
||
152 | * @return \Magento\Sales\Api\Data\OrderItemInterface[] |
||
153 | */ |
||
154 | private function getOrderItems(array $orderIds) : array |
||
164 | |||
165 | |||
166 | /** |
||
167 | * @param array $orderItemsIds |
||
168 | * |
||
169 | * @return \Magento\Framework\Api\SearchCriteriaInterface |
||
170 | */ |
||
171 | private function prepareOrderItemsSearchCriteria(array $orderItemsIds) : SearchCriteriaInterface |
||
176 | |||
177 | |||
178 | /** |
||
179 | * @throws \Exception |
||
180 | * |
||
181 | * @return \LizardMedia\ProductAttachment\Model\ResourceModel\Attachment\Collection |
||
182 | */ |
||
183 | private function returnEmptyAttachmentCollection() |
||
189 | |||
190 | |||
191 | /** |
||
192 | * @param array $productIds |
||
193 | * |
||
194 | * @throws \Exception |
||
195 | * |
||
196 | * @return \LizardMedia\ProductAttachment\Model\ResourceModel\Attachment\Collection |
||
197 | */ |
||
198 | private function getAttachments(array $productIds) : Collection |
||
209 | |||
210 | |||
211 | /** |
||
212 | * @return \LizardMedia\ProductAttachment\Model\ResourceModel\Attachment\Collection |
||
213 | */ |
||
214 | private function instantiateAttachmentCollection() : Collection |
||
218 | } |
||
219 |