vendor/store.shopware.com/nenomarketingessentials/src/Subscriber/ConversionBarEntitySubscriber.php line 32

Open in your IDE?
  1. <?php
  2. namespace Neno\MarketingEssentials\Subscriber;
  3. use Shopware\Core\Framework\Adapter\Cache\CacheClearer;
  4. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  5. use Shopware\Core\Framework\DataAbstractionLayer\Event\EntityWrittenEvent;
  6. class ConversionBarEntitySubscriber implements EventSubscriberInterface
  7. {
  8.     private CacheClearer $cacheClearer;
  9.     public function __construct
  10.     (
  11.         CacheClearer $cacheClearer
  12.     ) {
  13.         $this->cacheClearer $cacheClearer;
  14.     }
  15.     public static function getSubscribedEvents(): array
  16.     {
  17.         return [
  18.             'neno_marketing_essentials_conversion_bar.written' => 'onDataWritten',
  19.             'neno_marketing_essentials_conversion_bar.deleted' => 'onDataDeleted',
  20.         ];
  21.     }
  22.     public function onDataWritten(EntityWrittenEvent $event):void {
  23.         $this->cacheClearer->clear();
  24.     }
  25.     public function onDataDeleted(EntityWrittenEvent $event):void {
  26.         $this->cacheClearer->clear();
  27.     }
  28. }