Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-catalog
Model
ResourceModel
Product
Indexer
Price
CompositeProductRelationsCalculator.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Catalog\Model\ResourceModel\Product\Indexer\Price
;
8
12
class
CompositeProductRelationsCalculator
13
{
17
public
function
__construct
(
DefaultPrice
$indexerResource)
18
{
19
$this->indexerResource = $indexerResource;
20
}
21
27
public
function
getMaxRelationsCount
()
28
{
29
$connection
= $this->indexerResource->getConnection();
30
$relationSelect =
$connection
->select();
31
$relationSelect->from(
32
[
'relation'
=> $this->indexerResource->getTable(
'catalog_product_relation'
)],
33
[
'count'
=> new \Zend_Db_Expr(
'count(relation.child_id)'
)]
34
);
35
$relationSelect->group(
'parent_id'
);
36
37
$maxSelect =
$connection
->select();
38
$maxSelect->from(
39
[
'max_value'
=> $relationSelect],
40
[
'count'
=>
new
\
Zend_Db_Expr
(
'MAX(count)'
)]
41
);
42
return
$connection
->fetchOne($maxSelect);
43
}
44
}
Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductRelationsCalculator\getMaxRelationsCount
getMaxRelationsCount()
Definition:
CompositeProductRelationsCalculator.php:27
Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductRelationsCalculator
Definition:
CompositeProductRelationsCalculator.php:12
Zend_Db_Expr
Definition:
Expr.php:49
Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductRelationsCalculator\__construct
__construct(DefaultPrice $indexerResource)
Definition:
CompositeProductRelationsCalculator.php:17
Magento\Catalog\Model\ResourceModel\Product\Indexer\Price
Definition:
BasePriceModifier.php:8
$connection
$connection
Definition:
bulk.php:13
Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\DefaultPrice
Definition:
DefaultPrice.php:23