6 declare(strict_types=1);
22 private $flushCacheByProductIds;
27 private $getProductIdsByStockIds;
37 $this->flushCacheByProductIds = $flushCacheByProductIds;
38 $this->getProductIdsByStockIds = $getProductIdsForCacheFlush;
53 $beforeReindexProductIds = $this->getProductIdsByStockIds->execute(
$stockIds);
55 $afterReindexProductIds = $this->getProductIdsByStockIds->execute(
$stockIds);
56 $productIdsForCacheClean = array_diff($beforeReindexProductIds, $afterReindexProductIds);
57 if ($productIdsForCacheClean) {
58 $this->flushCacheByProductIds->execute($productIdsForCacheClean);
aroundExecuteList(StockIndexer $subject, callable $proceed, array $stockIds)
__construct(FlushCacheByProductIds $flushCacheByProductIds, GetProductIdsByStockIds $getProductIdsForCacheFlush)