cacheContext = $cacheContext; $this->eventManager = $eventManager; $this->productCacheTag = $productCacheTag; } /** * Clean cache for given product ids. * * @param array $productIds * @return void */ public function execute(array $productIds) { if ($productIds) { $this->cacheContext->registerEntities($this->productCacheTag, $productIds); $this->eventManager->dispatch('clean_cache_by_tags', ['object' => $this->cacheContext]); } } }