<?php declare(strict_types=1);
namespace ShopStudio\PixelYourShop\EventSubscriber;
use ShopStudio\PixelYourShop\View\TransientBag\Transient;
use ShopStudio\PixelYourShop\View\TransientBag\TransientBagInterface;
use Shopware\Core\Checkout\Customer\Event\CustomerRegisterEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
* @since 1.0.0
*/
class CustomerRegisterEventSubscriber implements EventSubscriberInterface
{
/**
* @since 1.0.0
*/
protected TransientBagInterface $transientBag;
/**
* @since 1.0.0
*/
public function __construct(TransientBagInterface $transientBag)
{
$this->transientBag = $transientBag;
}
/**
* @since 1.0.0
*
* @inheritDoc
*/
public static function getSubscribedEvents(): array
{
return [
CustomerRegisterEvent::EVENT_NAME => 'onCustomerRegisterEvent',
CustomerRegisterEvent::class => 'onCustomerRegisterEvent',
];
}
/**
* @since 1.0.0
*/
public function onCustomerRegisterEvent(): void
{
$this->transientBag->set(new Transient('register'));
}
}