public function purgeForContent($contentId) { $contentInfo = $this->contentService->loadContentInfo($contentId); $event = new ContentCacheClearEvent($contentInfo); $this->eventDispatcher->dispatch(MVCEvents::CACHE_CLEAR_CONTENT, $event); $locationIds = []; foreach ($event->getLocationsToClear() as $location) { $locationIds[] = $location->id; } $this->purgeClient->purge(array_unique($locationIds)); }
/** * {@inheritdoc} */ public function purgeForContent($contentId, $locationIds = []) { $contentInfo = $this->contentService->loadContentInfo($contentId); // Can only gather relevant locations using ContentCacheClearEvent on published content if ($contentInfo->published) { $event = new ContentCacheClearEvent($contentInfo); $this->eventDispatcher->dispatch(MVCEvents::CACHE_CLEAR_CONTENT, $event); foreach ($event->getLocationsToClear() as $location) { $locationIds[] = $location->id; } } $this->purgeClient->purge(array_unique($locationIds)); }
public function purgeAll() { $this->purgeClient->purgeAll(); }