File tree Expand file tree Collapse file tree 1 file changed +20
-4
lines changed
app/code/Magento/Catalog/Model/ResourceModel/Product/Compare Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change 88use Magento \Customer \Model \Config \Share ;
99use Magento \Store \Model \StoreManagerInterface ;
1010use Magento \Framework \App \ObjectManager ;
11+ use Magento \Framework \Model \ResourceModel \Db \Context ;
1112
1213/**
1314 * Catalog compare item resource model
@@ -27,16 +28,31 @@ class Item extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
2728 private $ storeManager ;
2829
2930 /**
30- * Initialize connection
31+ * Class constructor
3132 *
33+ * @param Context $context
34+ * @param string $connectionName
3235 * @param Share|null $share
3336 * @param StoreManagerInterface|null $storeManager
34- * @return void
3537 */
36- protected function _construct (?Share $ share = null , ?StoreManagerInterface $ storeManager = null )
37- {
38+ public function __construct (
39+ Context $ context ,
40+ $ connectionName = null ,
41+ ?Share $ share = null ,
42+ ?StoreManagerInterface $ storeManager = null
43+ ) {
3844 $ this ->share = $ share ?? ObjectManager::getInstance ()->get (Share::class);
3945 $ this ->storeManager = $ storeManager ?? ObjectManager::getInstance ()->get (StoreManagerInterface::class);
46+ parent ::__construct ($ context , $ connectionName );
47+ }
48+
49+ /**
50+ * Initialize connection
51+ *
52+ * @return void
53+ */
54+ protected function _construct ()
55+ {
4056 $ this ->_init ('catalog_compare_item ' , 'catalog_compare_item_id ' );
4157 }
4258
You can’t perform that action at this time.
0 commit comments