src/Offer/Serializer/Normalizer/OfferDraftEmailDraftAttachmentNormalizer.php line 42
<?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\Serializer\Normalizer;use App\Core\Serializer\Normalizer\AttributeAwareNormalizerTrait;use App\Offer\Model\OfferDraftEmailDraftAttachmentInterface;use Symfony\Component\Routing\Generator\UrlGeneratorInterface;use Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface;use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface;use Symfony\Component\Serializer\Normalizer\NormalizerInterface;final class OfferDraftEmailDraftAttachmentNormalizer implements ContextAwareNormalizerInterface, CacheableSupportsMethodInterface{use AttributeAwareNormalizerTrait;private NormalizerInterface $normalizer;private UrlGeneratorInterface $urlGenerator;public function __construct(NormalizerInterface $normalizer, UrlGeneratorInterface $urlGenerator){$this->normalizer = $normalizer;$this->urlGenerator = $urlGenerator;}public function normalize($object, string $format = null, array $context = []): float|int|bool|\ArrayObject|array|string|null{$data = $this->normalizer->normalize($object, $format, $context);if (true === $this->shouldSerializeAttribute($data, OfferDraftEmailDraftAttachmentInterface::ATTR__LINKS, $context)) {$this->normalize_Links($object, $data);}return $data;}public function supportsNormalization($data, string $format = null, array $context = []): bool{return $data instanceof OfferDraftEmailDraftAttachmentInterface;}public function hasCacheableSupportsMethod(): bool{return __CLASS__ === static::class;}private function normalize_Links(OfferDraftEmailDraftAttachmentInterface $attachment, array &$data): void{$data[OfferDraftEmailDraftAttachmentInterface::ATTR__LINKS] = ['ajax' => ['delete' => $this->urlGenerator->generate('app_offer_ajax_offer_draft_email_draft_attachment_delete', ['id' => $attachment->getId(),]),],'http' => ['download' => $this->urlGenerator->generate('app_offer_http_offer_draft_email_draft_attachment_download', ['id' => $attachment->getId(),]),],];}}