Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Rss.php
Go to the documentation of this file.
1 <?php
6 namespace Magento\Review\Model;
7 
13 {
17  protected $reviewFactory;
18 
24  protected $eventManager;
25 
30  public function __construct(
31  \Magento\Framework\Event\ManagerInterface $eventManager,
32  \Magento\Review\Model\ReviewFactory $reviewFactory
33  ) {
34  $this->reviewFactory = $reviewFactory;
35  $this->eventManager = $eventManager;
36  }
37 
41  public function getProductCollection()
42  {
44  $reviewModel = $this->reviewFactory->create();
45  $collection = $reviewModel->getProductCollection()
46  ->addStatusFilter($reviewModel->getPendingStatus())
47  ->addAttributeToSelect('name', 'inner')
48  ->setDateOrder();
49 
50  $this->eventManager->dispatch('rss_catalog_review_collection_select', ['collection' => $collection]);
51  return $collection;
52  }
53 }
__construct(\Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Review\Model\ReviewFactory $reviewFactory)
Definition: Rss.php:30