9
9
use Magento \Store \Model \ScopeInterface ;
10
10
11
11
/**
12
+ * Saves data from order to purchased links.
13
+ *
12
14
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
13
15
*/
14
16
class SaveDownloadableOrderItemObserver implements ObserverInterface
@@ -159,7 +161,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
159
161
\Magento \Sales \Model \Order \Item::STATUS_PENDING == $ orderStatusToEnableItem ?
160
162
\Magento \Downloadable \Model \Link \Purchased \Item::LINK_STATUS_AVAILABLE :
161
163
\Magento \Downloadable \Model \Link \Purchased \Item::LINK_STATUS_PENDING
162
- )->setCreatedAt (
164
+ )->setCreatedAt (
163
165
$ orderItem ->getCreatedAt ()
164
166
)->setUpdatedAt (
165
167
$ orderItem ->getUpdatedAt ()
@@ -173,6 +175,8 @@ public function execute(\Magento\Framework\Event\Observer $observer)
173
175
}
174
176
175
177
/**
178
+ * Create purchased model.
179
+ *
176
180
* @return \Magento\Downloadable\Model\Link\Purchased
177
181
*/
178
182
protected function _createPurchasedModel ()
@@ -181,6 +185,8 @@ protected function _createPurchasedModel()
181
185
}
182
186
183
187
/**
188
+ * Create product model.
189
+ *
184
190
* @return \Magento\Catalog\Model\Product
185
191
*/
186
192
protected function _createProductModel ()
@@ -189,6 +195,8 @@ protected function _createProductModel()
189
195
}
190
196
191
197
/**
198
+ * Create purchased item model.
199
+ *
192
200
* @return \Magento\Downloadable\Model\Link\Purchased\Item
193
201
*/
194
202
protected function _createPurchasedItemModel ()
@@ -197,6 +205,8 @@ protected function _createPurchasedItemModel()
197
205
}
198
206
199
207
/**
208
+ * Create items collection.
209
+ *
200
210
* @return \Magento\Downloadable\Model\ResourceModel\Link\Purchased\Item\Collection
201
211
*/
202
212
protected function _createItemsCollection ()
0 commit comments