@@ -23,7 +23,7 @@ class LastOrderedItems implements SectionSourceInterface
2323 const SIDEBAR_ORDER_LIMIT = 5 ;
2424
2525 /**
26- * @var \Magento\Sales\Model\ResourceModel\Order\CollectionFactory
26+ * @var \Magento\Sales\Model\ResourceModel\Order\CollectionFactoryInterface
2727 */
2828 protected $ _orderCollectionFactory ;
2929
@@ -68,7 +68,7 @@ class LastOrderedItems implements SectionSourceInterface
6868 private $ logger ;
6969
7070 /**
71- * @param \Magento\Sales\Model\ResourceModel\Order\CollectionFactory $orderCollectionFactory
71+ * @param \Magento\Sales\Model\ResourceModel\Order\CollectionFactoryInterface $orderCollectionFactory
7272 * @param \Magento\Sales\Model\Order\Config $orderConfig
7373 * @param \Magento\Customer\Model\Session $customerSession
7474 * @param \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry
@@ -77,7 +77,7 @@ class LastOrderedItems implements SectionSourceInterface
7777 * @param LoggerInterface $logger
7878 */
7979 public function __construct (
80- \Magento \Sales \Model \ResourceModel \Order \CollectionFactory $ orderCollectionFactory ,
80+ \Magento \Sales \Model \ResourceModel \Order \CollectionFactoryInterface $ orderCollectionFactory ,
8181 \Magento \Sales \Model \Order \Config $ orderConfig ,
8282 \Magento \Customer \Model \Session $ customerSession ,
8383 \Magento \CatalogInventory \Api \StockRegistryInterface $ stockRegistry ,
@@ -103,7 +103,7 @@ protected function initOrders()
103103 {
104104 $ customerId = $ this ->_customerSession ->getCustomerId ();
105105
106- $ orders = $ this ->_orderCollectionFactory ->create ()
106+ $ orders = $ this ->_orderCollectionFactory ->create ($ customerId )
107107 ->addAttributeToFilter ('customer_id ' , $ customerId )
108108 ->addAttributeToFilter ('status ' , ['in ' => $ this ->_orderConfig ->getVisibleOnFrontStatuses ()])
109109 ->addAttributeToSort ('created_at ' , 'desc ' )
@@ -138,7 +138,7 @@ protected function getItems()
138138 $ this ->logger ->critical ($ noEntityException );
139139 continue ;
140140 }
141- if (isset ( $ product ) && in_array ($ website , $ product ->getWebsiteIds ())) {
141+ if (in_array ($ website , $ product ->getWebsiteIds ())) {
142142 $ url = $ product ->isVisibleInSiteVisibility () ? $ product ->getProductUrl () : null ;
143143 $ items [] = [
144144 'id ' => $ item ->getId (),
@@ -188,7 +188,7 @@ protected function getLastOrder()
188188 }
189189
190190 /**
191- * { @inheritdoc}
191+ * @inheritdoc
192192 */
193193 public function getSectionData ()
194194 {
0 commit comments