items ??= $this->provider->getCollection((int)$this->session->getCustomerId()); } public function getRatings(): \Magento\Review\Model\ResourceModel\Rating\Collection { return $this->ratings->create()->getResourceCollection()->addEntityFilter('product') ->setPositionOrder()->addRatingPerStoreName((int)$this->_storeManager->getStore()->getId()) ->setStoreFilter((int)$this->_storeManager->getStore()->getId())->setActiveFilter(true) ->load()->addOptionToItems(); } public function getImageUrl(\Magento\Sales\Model\Order\Item $item): string { return $item->getProduct() ? $this->imageHelper->init($item->getProduct(), 'wishlist_thumbnail')->getUrl() : $this->imageHelper->getDefaultPlaceholderUrl('thumbnail'); } public function getPostUrl(int $productId): string { return $this->getUrl('review/product/post', ['id' => $productId, '_secure' => $this->getRequest()->isSecure()]); } protected function _prepareLayout(): self { parent::_prepareLayout(); $pager = $this->getLayout()->createBlock(\Magento\Theme\Block\Html\Pager::class, 'esun.review.awaiting.pager') ->setLimit(10) ->setShowPerPage(false) ->setCollection($this->getItems()); $this->setChild('pager', $pager); return $this; } }