Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CacheFlush.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
13 
18 {
22  private $flushCacheByIds;
23 
27  private $getProductIdsBySourceItemIds;
28 
33  public function __construct(
34  FlushCacheByProductIds $flushCacheByIds,
35  GetProductIdsBySourceItemIds $getProductIdsBySourceItemIds
36  ) {
37  $this->flushCacheByIds = $flushCacheByIds;
38  $this->getProductIdsBySourceItemIds = $getProductIdsBySourceItemIds;
39  }
40 
50  public function afterExecuteList(SourceItemIndexer $subject, $result, array $sourceItemIds)
51  {
52  $productIds = $this->getProductIdsBySourceItemIds->execute($sourceItemIds);
53  $this->flushCacheByIds->execute($productIds);
54  }
55 }
afterExecuteList(SourceItemIndexer $subject, $result, array $sourceItemIds)
Definition: CacheFlush.php:50
__construct(FlushCacheByProductIds $flushCacheByIds, GetProductIdsBySourceItemIds $getProductIdsBySourceItemIds)
Definition: CacheFlush.php:33