<?php
namespace Enid\EnidConnectorNext\Subscriber;
use Enid\EnidConnectorNext\Service\SettingService;
use Shopware\Storefront\Pagelet\Footer\FooterPageletLoadedEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class NetIDSubscriber implements EventSubscriberInterface
{
/**
* @var \Enid\EnidConnectorNext\Service\SettingService
*/
private SettingService $settingService;
public function __construct(
SettingService $settingService
)
{
$this->settingService = $settingService;
}
public static function getSubscribedEvents(): array
{
return [
FooterPageletLoadedEvent::class => 'onFooterLoaded'
];
}
public function onFooterLoaded(FooterPageletLoadedEvent $event)
{
$event->getPagelet()->addExtension('enidConnectorNextThemeSettings',
$this->settingService->getThemeSettings($event->getSalesChannelContext()->getSalesChannelId())
);
}
}