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-rule-configurable
Plugin
CatalogRule
Model
ConfigurableProductsProvider.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\CatalogRuleConfigurable\Plugin\CatalogRule\Model
;
8
9
class
ConfigurableProductsProvider
10
{
14
private
$resource;
15
19
private
$productIds = [];
20
24
public
function
__construct
(\
Magento
\Framework\
App
\ResourceConnection $resource)
25
{
26
$this->resource =
$resource
;
27
}
28
33
public
function
getIds
(array $ids)
34
{
35
$key = md5(json_encode($ids));
36
if
(!isset($this->productIds[$key])) {
37
$connection
= $this->resource->getConnection();
38
$this->productIds[$key] =
$connection
->fetchCol(
39
$connection
40
->select()
41
->from([
'e'
=> $this->resource->getTableName(
'catalog_product_entity'
)], [
'e.entity_id'
])
42
->where(
'e.type_id = ?'
, \
Magento
\
ConfigurableProduct
\Model\Product\Type\Configurable::TYPE_CODE)
43
->where(
'e.entity_id IN (?)'
, $ids)
44
);
45
}
46
return
$this->productIds[$key];
47
}
48
}
Magento\Framework\App
Magento\CatalogRuleConfigurable\Plugin\CatalogRule\Model\ConfigurableProductsProvider\__construct
__construct(\Magento\Framework\App\ResourceConnection $resource)
Definition:
ConfigurableProductsProvider.php:24
$resource
$resource
Definition:
bulk.php:12
Magento\CatalogRuleConfigurable\Plugin\CatalogRule\Model\ConfigurableProductsProvider
Definition:
ConfigurableProductsProvider.php:9
Magento\CatalogRuleConfigurable\Plugin\CatalogRule\Model\ConfigurableProductsProvider\getIds
getIds(array $ids)
Definition:
ConfigurableProductsProvider.php:33
Magento\ConfigurableProduct\Model\Product\Type\Configurable
Definition:
AttributeTest.php:6
Magento
$connection
$connection
Definition:
bulk.php:13
Magento\CatalogRuleConfigurable\Plugin\CatalogRule\Model
Definition:
ConfigurableProductsProvider.php:7