custom/static-plugins/PixupWishlistSW6/src/Subscriber/WishlistCustomerLogoutSubscriber.php line 26

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Pixup\Wishlist\Subscriber;
  3. use Shopware\Core\Checkout\Customer\Event\CustomerLogoutEvent;
  4. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  5. use Symfony\Component\HttpFoundation\Session\Session;
  6. class WishlistCustomerLogoutSubscriber implements EventSubscriberInterface
  7. {
  8.     /** @var Session */
  9.     private $session;
  10.     public function __construct(Session $session)
  11.     {
  12.         $this->session $session;
  13.     }
  14.     public static function getSubscribedEvents()
  15.     {
  16.         return [
  17.             CustomerLogoutEvent::class => 'removeWishlistSessionAttributes'
  18.         ];
  19.     }
  20.     public function removeWishlistSessionAttributes(CustomerLogoutEvent $event)
  21.     {
  22.         $this->session->remove('wishlists');
  23.     }
  24. }