I have overrides the Magento\Review\Model\ResourceModel\Review\Collection in my custom module, But it throws an exception like
1 exception(s): Exception #0 (Zend_Db_Select_Exception): You cannot define a correlation name ‘detail’ more than once
Exception #0 (Zend_Db_Select_Exception): You cannot define a correlation name ‘detail’ more than once
My overrided file Collection.php
<?php namespace X\Y\Model\ResourceModel\Review; class Collection extends \Magento\Review\Model\ResourceModel\Review\Collection { public function __construct( \Magento\Framework\Data\Collection\EntityFactory $ entityFactory, \Psr\Log\LoggerInterface $ logger, \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $ fetchStrategy, \Magento\Framework\Event\ManagerInterface $ eventManager, \Magento\Review\Helper\Data $ reviewData, \Magento\Review\Model\Rating\Option\VoteFactory $ voteFactory, \Magento\Store\Model\StoreManagerInterface $ storeManager, \Magento\Framework\DB\Adapter\AdapterInterface $ connection = null, \Magento\Framework\Model\ResourceModel\Db\AbstractDb $ resource = null ) { $ this->_reviewData = $ reviewData; $ this->_voteFactory = $ voteFactory; $ this->_storeManager = $ storeManager; parent::__construct($ entityFactory, $ logger, $ fetchStrategy, $ eventManager, $ reviewData, $ voteFactory, $ storeManager, $ connection, $ resource); } protected function _construct() { $ this->_init(\Magento\Review\Model\Review::class, \Magento\Review\Model\ResourceModel\Review::class); } protected function _initSelect() { parent::_initSelect(); $ this->getSelect()->join( ['detail' => $ this->getReviewDetailTable()], 'main_table.review_id = detail.review_id', ['detail_id', 'title', 'detail', 'nickname', 'customer_id', 'visibility'] ); return $ this; } }