src/Offer/EventSubscriber/SetOfferDraftEmailDraftAttachmentMetaSubscriber.php line 44
<?phpdeclare(strict_types=1);/*** Copyright (c) 2021 TECLA Consulting Group oü.* All rights reserved.** This unpublished material is proprietary to TECLA Consulting Group oü.* All rights reserved. The methods and* techniques described herein are considered trade secrets* and/or confidential. Reproduction or distribution, in whole* or in part, is forbidden except by express written permission* of TECLA Consulting Group oü.** @author Matúš Sýkorjak <matus@tecla.no>* @copyright 2021 TECLA Consulting Group oü*/namespace App\Offer\EventSubscriber;use App\Contact\Security\ContactContextInterface;use App\Offer\Event\OfferDraftEmailDraftAttachment\CreateEvent;use DateTimeImmutable;use JetBrains\PhpStorm\ArrayShape;use Symfony\Component\EventDispatcher\EventSubscriberInterface;final class SetOfferDraftEmailDraftAttachmentMetaSubscriber implements EventSubscriberInterface{private ContactContextInterface $context;public function __construct(ContactContextInterface $context){$this->context = $context;}#[ArrayShape([CreateEvent::class => 'array'])]public static function getSubscribedEvents(): array{return [CreateEvent::class => ['onCreate', -1024],];}public function onCreate(CreateEvent $event): void{$attachment = $event->getAttachment();$attachment->setCreatedBy($this->context->getBase());$attachment->setCreatedAt(new DateTimeImmutable());}}