5
5
*/
6
6
namespace Magento \Catalog \Model ;
7
7
8
+ use Magento \Catalog \Model \Indexer \Category \Product \AbstractAction ;
8
9
use Magento \Framework \DB \Select ;
9
10
use Magento \Framework \DB \Sql \UnionExpression ;
10
- use Magento \Indexer \Model \ResourceModel \FrontendResource ;
11
11
12
12
/**
13
13
* Provides info about product categories.
@@ -29,24 +29,16 @@ class ProductCategoryList
29
29
*/
30
30
private $ category ;
31
31
32
- /**
33
- * @var FrontendResource
34
- */
35
- private $ categoryProductIndexerFrontend ;
36
-
37
32
/**
38
33
* @param ResourceModel\Product $productResource
39
34
* @param ResourceModel\Category $category
40
- * @param FrontendResource $categoryProductIndexerFrontend
41
35
*/
42
36
public function __construct (
43
37
ResourceModel \Product $ productResource ,
44
- ResourceModel \Category $ category ,
45
- FrontendResource $ categoryProductIndexerFrontend
38
+ ResourceModel \Category $ category
46
39
) {
47
40
$ this ->productResource = $ productResource ;
48
41
$ this ->category = $ category ;
49
- $ this ->categoryProductIndexerFrontend = $ categoryProductIndexerFrontend ;
50
42
}
51
43
52
44
/**
@@ -61,7 +53,10 @@ public function getCategoryIds($productId)
61
53
$ unionSelect = new UnionExpression (
62
54
[
63
55
$ this ->getCategorySelect ($ productId , $ this ->category ->getCategoryProductTable ()),
64
- $ this ->getCategorySelect ($ productId , $ this ->categoryProductIndexerFrontend ->getMainTable ())
56
+ $ this ->getCategorySelect (
57
+ $ productId ,
58
+ $ this ->productResource ->getTable (AbstractAction::MAIN_INDEX_TABLE )
59
+ )
65
60
],
66
61
Select::SQL_UNION_ALL
67
62
);
0 commit comments