File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
app/code/Magento/Catalog/Model Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -29,14 +29,16 @@ class CategoryLinkRepository implements \Magento\Catalog\Api\CategoryLinkReposit
29
29
/**
30
30
* @param \Magento\Catalog\Api\CategoryRepositoryInterface $categoryRepository
31
31
* @param \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
32
+ * @param \Magento\Catalog\Model\ResourceModel\Product $productResource
32
33
*/
33
34
public function __construct (
34
35
\Magento \Catalog \Api \CategoryRepositoryInterface $ categoryRepository ,
35
- \Magento \Catalog \Api \ProductRepositoryInterface $ productRepository
36
+ \Magento \Catalog \Api \ProductRepositoryInterface $ productRepository ,
37
+ \Magento \Catalog \Model \ResourceModel \Product $ productResource = null
36
38
) {
37
39
$ this ->categoryRepository = $ categoryRepository ;
38
40
$ this ->productRepository = $ productRepository ;
39
- $ this ->productResource = \Magento \Framework \App \ObjectManager::getInstance ()->get (\Magento \Catalog \Model \ResourceModel \Product::class);
41
+ $ this ->productResource = $ productResource ?? \Magento \Framework \App \ObjectManager::getInstance ()->get (\Magento \Catalog \Model \ResourceModel \Product::class);
40
42
}
41
43
42
44
/**
You can’t perform that action at this time.
0 commit comments