<?php declare(strict_types=1);
/**
* valantic CEC Deutschland GmbH
* Copyright (c) 2023.
*
* All rights reserved.
*
* @see https://www.valantic.com/
*
* @author andrei
* Date: 07.06.2023 15:31
*/
namespace Valantic\Bundle\PentagastBundle\Subscriber;
use Shopware\Core\Framework\DataAbstractionLayer\Event\EntityWrittenEvent;
use Shopware\Core\System\SalesChannel\SalesChannelEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Valantic\Bundle\PentagastBundle\Service\SalesChannelMediaUploadService;
class SalesChannelSubscriber implements EventSubscriberInterface
{
public function __construct(
private SalesChannelMediaUploadService $salesChannelMediaUploadService
) {
}
public static function getSubscribedEvents(): array
{
return [
SalesChannelEvents::SALES_CHANNEL_WRITTEN => 'writeDocumentFileMediaUploadFolder',
];
}
public function writeDocumentFileMediaUploadFolder(EntityWrittenEvent $event): void
{
$this->salesChannelMediaUploadService->writeDocumentFileMediaUploadFolder($event);
}
}