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-inventory-cache
Model
FlushCacheByProductIds.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\InventoryCache\Model
;
9
10
use
Magento\Framework\EntityManager\EventManager
;
11
use
Magento\Framework\Indexer\CacheContext
;
12
16
class
FlushCacheByProductIds
17
{
21
private
$cacheContext;
22
26
private
$eventManager;
27
31
private
$productCacheTag;
32
38
public
function
__construct
(
39
CacheContext
$cacheContext,
40
EventManager
$eventManager,
41
string
$productCacheTag
42
) {
43
$this->cacheContext = $cacheContext;
44
$this->eventManager = $eventManager;
45
$this->productCacheTag = $productCacheTag;
46
}
47
54
public
function
execute
(array
$productIds
)
55
{
56
if
(
$productIds
) {
57
$this->cacheContext->registerEntities($this->productCacheTag,
$productIds
);
58
$this->eventManager->dispatch(
'clean_cache_by_tags'
, [
'object'
=> $this->cacheContext]);
59
}
60
}
61
}
Magento\InventoryCache\Model
Definition:
FlushCacheByProductIds.php:8
Magento\InventoryCache\Model\FlushCacheByProductIds\execute
execute(array $productIds)
Definition:
FlushCacheByProductIds.php:54
Magento\InventoryCache\Model\FlushCacheByProductIds\__construct
__construct(CacheContext $cacheContext, EventManager $eventManager, string $productCacheTag)
Definition:
FlushCacheByProductIds.php:38
Magento\InventoryCache\Model\FlushCacheByProductIds
Definition:
FlushCacheByProductIds.php:16
Magento\Framework\EntityManager\EventManager
Definition:
EventManager.php:14
Magento\Framework\Indexer\CacheContext
Definition:
CacheContext.php:11
$productIds
$productIds
Definition:
product_with_multiple_options.php:11