vendor/ibexa/http-cache/src/lib/EventSubscriber/CachePurge/TranslationEventsSubscriber.php line 22

Open in your IDE?
  1. <?php
  2. /**
  3.  * @copyright Copyright (C) Ibexa AS. All rights reserved.
  4.  * @license For full copyright and license information view LICENSE file distributed with this source code.
  5.  */
  6. declare(strict_types=1);
  7. namespace Ibexa\HttpCache\EventSubscriber\CachePurge;
  8. use Ibexa\Contracts\Core\Repository\Events\Content\DeleteTranslationEvent;
  9. final class TranslationEventsSubscriber extends AbstractSubscriber
  10. {
  11.     public static function getSubscribedEvents(): array
  12.     {
  13.         return [
  14.             DeleteTranslationEvent::class => 'onDeleteTranslation',
  15.         ];
  16.     }
  17.     public function onDeleteTranslation(DeleteTranslationEvent $event): void
  18.     {
  19.         $contentId $event->getContentInfo()->id;
  20.         $tags array_merge(
  21.             $this->getContentTags($contentId),
  22.             $this->getContentLocationsTags($contentId)
  23.         );
  24.         $this->purgeClient->purge($tags);
  25.     }
  26. }
  27. class_alias(TranslationEventsSubscriber::class, 'EzSystems\PlatformHttpCacheBundle\EventSubscriber\CachePurge\TranslationEventsSubscriber');