src/PentagastBundle/Subscriber/SalesChannelSubscriber.php line 35

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. /**
  3.  * valantic CEC Deutschland GmbH
  4.  * Copyright (c) 2023.
  5.  *
  6.  * All rights reserved.
  7.  *
  8.  * @see https://www.valantic.com/
  9.  *
  10.  * @author andrei
  11.  * Date: 07.06.2023 15:31
  12.  */
  13. namespace Valantic\Bundle\PentagastBundle\Subscriber;
  14. use Shopware\Core\Framework\DataAbstractionLayer\Event\EntityWrittenEvent;
  15. use Shopware\Core\System\SalesChannel\SalesChannelEvents;
  16. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  17. use Valantic\Bundle\PentagastBundle\Service\SalesChannelMediaUploadService;
  18. class SalesChannelSubscriber implements EventSubscriberInterface
  19. {
  20.     public function __construct(
  21.         private SalesChannelMediaUploadService $salesChannelMediaUploadService
  22.     ) {
  23.     }
  24.     public static function getSubscribedEvents(): array
  25.     {
  26.         return [
  27.             SalesChannelEvents::SALES_CHANNEL_WRITTEN => 'writeDocumentFileMediaUploadFolder',
  28.         ];
  29.     }
  30.     public function writeDocumentFileMediaUploadFolder(EntityWrittenEvent $event): void
  31.     {
  32.         $this->salesChannelMediaUploadService->writeDocumentFileMediaUploadFolder($event);
  33.     }
  34. }