Skip to content

Resolve model Rss extends wrong class #24183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions app/code/Magento/Review/Model/Rss.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

declare(strict_types=1);

namespace Magento\Review\Model;

use Magento\Framework\App\ObjectManager;

/**
* Class Rss
* @package Magento\Catalog\Model\Rss\Product
* Model Rss
*
* Class \Magento\Catalog\Model\Rss\Product\Rss
*/
class Rss extends \Magento\Framework\Model\AbstractModel
{
Expand All @@ -24,18 +30,35 @@ class Rss extends \Magento\Framework\Model\AbstractModel
protected $eventManager;

/**
* Rss constructor.
*
* @param \Magento\Framework\Event\ManagerInterface $eventManager
* @param ReviewFactory $reviewFactory
* @param \Magento\Framework\Model\Context|null $context
* @param \Magento\Framework\Registry|null $registry
* @param \Magento\Framework\Model\ResourceModel\AbstractResource|null $resource
* @param \Magento\Framework\Data\Collection\AbstractDb|null $resourceCollection
* @param array $data
*/
public function __construct(
\Magento\Framework\Event\ManagerInterface $eventManager,
\Magento\Review\Model\ReviewFactory $reviewFactory
\Magento\Review\Model\ReviewFactory $reviewFactory,
\Magento\Framework\Model\Context $context = null,
\Magento\Framework\Registry $registry = null,
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
array $data = []
) {
$this->reviewFactory = $reviewFactory;
$this->eventManager = $eventManager;
$context = $context ?? ObjectManager::getInstance()->get(\Magento\Framework\Model\Context::class);
$registry = $registry ?? ObjectManager::getInstance()->get(\Magento\Framework\Registry::class);
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
}

/**
* Get Product Collection
*
* @return $this|\Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
*/
public function getProductCollection()
Expand Down