vendor/shopware/core/Content/Mail/Service/Mail.php line 9

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\Content\Mail\Service;
  3. use Shopware\Core\Framework\Log\Package;
  4. use Symfony\Component\Mime\Email;
  5. #[Package('system-settings')]
  6. class Mail extends Email
  7. {
  8.     private ?MailAttachmentsConfig $mailAttachmentsConfig null;
  9.     /**
  10.      * @var string[]
  11.      */
  12.     private array $attachmentUrls = [];
  13.     /**
  14.      * @return mixed[]
  15.      */
  16.     public function __serialize(): array
  17.     {
  18.         $data parent::__serialize();
  19.         $data[] = $this->mailAttachmentsConfig;
  20.         $data[] = $this->attachmentUrls;
  21.         return $data;
  22.     }
  23.     /**
  24.      * @param mixed[] $data
  25.      */
  26.     public function __unserialize(array $data): void
  27.     {
  28.         [$this->mailAttachmentsConfig$this->attachmentUrls] = array_splice($data, -22);
  29.         parent::__unserialize($data);
  30.     }
  31.     public function getMailAttachmentsConfig(): ?MailAttachmentsConfig
  32.     {
  33.         return $this->mailAttachmentsConfig;
  34.     }
  35.     public function setMailAttachmentsConfig(?MailAttachmentsConfig $mailAttachmentsConfig): self
  36.     {
  37.         $this->mailAttachmentsConfig $mailAttachmentsConfig;
  38.         return $this;
  39.     }
  40.     /**
  41.      * @return string[]
  42.      */
  43.     public function getAttachmentUrls(): array
  44.     {
  45.         return $this->attachmentUrls;
  46.     }
  47.     public function addAttachmentUrl(string $url): self
  48.     {
  49.         $this->attachmentUrls[] = $url;
  50.         return $this;
  51.     }
  52. }