@@ -14,19 +14,19 @@ class CompositeProductRowSizeEstimator implements \Magento\Framework\Indexer\Ind
14
14
private $ indexTableRowSizeEstimator ;
15
15
16
16
/**
17
- * @var \Magento\Framework\App\ResourceConnection
17
+ * @var \Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\DefaultPrice
18
18
*/
19
- private $ resourceConnection ;
19
+ private $ indexerResource ;
20
20
21
21
/**
22
- * @param \Magento\Framework\App\ResourceConnection $resourceConnection
22
+ * @param DefaultPrice $indexerResource
23
23
* @param \Magento\Indexer\Model\IndexTableRowSizeEstimator $indexTableRowSizeEstimator
24
24
*/
25
25
public function __construct (
26
- \Magento \Framework \ App \ ResourceConnection $ resourceConnection ,
26
+ \Magento \Catalog \ Model \ ResourceModel \ Product \ Indexer \ Price \ DefaultPrice $ indexerResource ,
27
27
\Magento \Indexer \Model \IndexTableRowSizeEstimator $ indexTableRowSizeEstimator
28
28
) {
29
- $ this ->resourceConnection = $ resourceConnection ;
29
+ $ this ->indexerResource = $ indexerResource ;
30
30
$ this ->indexTableRowSizeEstimator = $ indexTableRowSizeEstimator ;
31
31
}
32
32
@@ -37,10 +37,10 @@ public function __construct(
37
37
*/
38
38
public function estimateRowSize ()
39
39
{
40
- $ connection = $ this ->resourceConnection ->getConnection ();
40
+ $ connection = $ this ->indexerResource ->getConnection ();
41
41
$ relationSelect = $ connection ->select ();
42
42
$ relationSelect ->from (
43
- ['relation ' => $ connection -> getTableName ('catalog_product_relation ' )],
43
+ ['relation ' => $ this -> indexerResource -> getTable ('catalog_product_relation ' )],
44
44
['count ' => new \Zend_Db_Expr ('count(relation.child_id) ' )]
45
45
);
46
46
$ relationSelect ->group ('parent_id ' );
0 commit comments