public function invalidateProductIds(ProductChangedEventInterface
$event): void
{ // invalidates all routes which loads products in nested unknown objects, like cms listing elements or cross selling elements
$this->cacheInvalidator->
invalidate(array_map(EntityCacheKeyGenerator::
buildProductTag(...
),
$event->
getIds()));
} public function invalidateStreamIds(EntityWrittenContainerEvent
$event): void
{ // invalidates all routes which are loaded based on a stream (e.G. category listing and cross selling)
/** @var list<string> $ids */
$ids =
array_map(EntityCacheKeyGenerator::
buildStreamTag(...
),
$event->
getPrimaryKeys(ProductStreamDefinition::ENTITY_NAME
));
$this->cacheInvalidator->
invalidate($ids);
} public function invalidateCategoryRouteByCategoryIds(CategoryIndexerEvent
$event): void
{ // invalidates the category route cache when a category changed
$this->cacheInvalidator->
invalidate(array_map(CachedCategoryRoute::
buildName(...
),
$event->
getIds()));
} public function invalidateListingRouteByCategoryIds(CategoryIndexerEvent
$event): void
{