vendor/shopware/core/Framework/Webhook/WebhookCacheClearer.php line 27

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\Framework\Webhook;
  3. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  4. class WebhookCacheClearer implements EventSubscriberInterface
  5. {
  6.     /**
  7.      * @var WebhookDispatcher
  8.      */
  9.     private $dispatcher;
  10.     public function __construct(WebhookDispatcher $dispatcher)
  11.     {
  12.         $this->dispatcher $dispatcher;
  13.     }
  14.     public static function getSubscribedEvents(): array
  15.     {
  16.         return [
  17.             'webhook.written' => 'clearWebhookCache',
  18.             'acl_role.written' => 'clearPrivilegesCache',
  19.         ];
  20.     }
  21.     public function clearWebhookCache(): void
  22.     {
  23.         $this->dispatcher->clearInternalWebhookCache();
  24.     }
  25.     public function clearPrivilegesCache(): void
  26.     {
  27.         $this->dispatcher->clearInternalPrivilegesCache();
  28.     }
  29. }