public function invalidateCmsPageIds(EntityWrittenContainerEvent
$event): void
{ // invalidates all routes and http cache pages where a cms page was loaded, the id is assigned as tag
/** @var list<string> $ids */
$ids =
array_map(EntityCacheKeyGenerator::
buildCmsTag(...
),
$event->
getPrimaryKeys(CmsPageDefinition::ENTITY_NAME
));
$this->cacheInvalidator->
invalidate($ids);
} 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
{