@@ -48,9 +48,9 @@ class Category extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
48
48
protected $ metadataPool ;
49
49
50
50
/**
51
- * @var ManagerInterface
51
+ * @var SelectWrapper
52
52
*/
53
- private $ eventManager ;
53
+ private $ selectWrapper ;
54
54
55
55
/**
56
56
* @param \Magento\Framework\Model\ResourceModel\Db\Context $context
@@ -66,13 +66,13 @@ public function __construct(
66
66
\Magento \Catalog \Model \ResourceModel \Category $ categoryResource ,
67
67
\Magento \Framework \EntityManager \MetadataPool $ metadataPool ,
68
68
$ connectionName = null ,
69
- ManagerInterface $ eventManager = null
69
+ SelectWrapper $ selectWrapper = null
70
70
) {
71
71
$ this ->_storeManager = $ storeManager ;
72
72
$ this ->_categoryResource = $ categoryResource ;
73
73
parent ::__construct ($ context , $ connectionName );
74
74
$ this ->metadataPool = $ metadataPool ;
75
- $ this ->eventManager = $ eventManager ?? ObjectManager::getInstance ()->get (ManagerInterface ::class);
75
+ $ this ->selectWrapper = $ selectWrapper ?? ObjectManager::getInstance ()->get (SelectWrapper ::class);
76
76
}
77
77
78
78
/**
@@ -132,12 +132,9 @@ public function getCollection($storeId)
132
132
133
133
$ this ->_addFilter ($ storeId , 'is_active ' , 1 );
134
134
135
- $ this ->eventManager ->dispatch (
136
- 'sitemap_category_select_init ' ,
137
- ['select ' => $ this ->_select ]
135
+ $ query = $ connection ->query (
136
+ $ this ->selectWrapper ->getSelectStatement ($ this ->_select )
138
137
);
139
-
140
- $ query = $ connection ->query ($ this ->_select );
141
138
while ($ row = $ query ->fetch ()) {
142
139
$ category = $ this ->_prepareCategory ($ row );
143
140
$ categories [$ category ->getId ()] = $ category ;
0 commit comments