<?php declare(strict_types=1);
namespace RHWeb\BasicTheme\Subscriber;
use Shopware\Core\Framework\Struct\ArrayEntity;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Shopware\Storefront\Event\StorefrontRenderEvent;
class StorefrontSubscriber implements EventSubscriberInterface
{
/**
* @var string
*/
private $themeType = 'RHWebSelfHostedTheme';
public static function getSubscribedEvents(): array
{
return [
StorefrontRenderEvent::class => 'addThemeType',
];
}
public function addThemeType(StorefrontRenderEvent $event)
{
$config = [];
$config['selfHosted'] = true;
$event->getContext()->addExtension($this->themeType, new ArrayEntity($config));
}
}