-
Notifications
You must be signed in to change notification settings - Fork 0
/
AttachmentEmail.php
42 lines (32 loc) · 1.06 KB
/
AttachmentEmail.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/*
* Copyright (c) Fusonic GmbH. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*/
declare(strict_types=1);
namespace Fusonic\MessengerMailerBundle\Component\Mime;
use Fusonic\MessengerMailerBundle\Helper\RandomHelper;
use Symfony\Component\Mime\Email;
use Symfony\Component\Mime\Header\Headers;
use Symfony\Component\Mime\Part\AbstractPart;
class AttachmentEmail extends Email implements AttachmentEmailInterface
{
use AttachmentEmailTrait;
public function __construct(?Headers $headers = null, ?AbstractPart $body = null)
{
$this->id = RandomHelper::randomHex();
parent::__construct($headers, $body);
}
public function __serialize(): array
{
return [$this->id, $this->persistedAttachments, parent::__serialize()];
}
/**
* @param array<mixed> $data
*/
public function __unserialize(array $data): void
{
[$this->id, $this->persistedAttachments, $parentData] = $data;
parent::__unserialize($parentData);
}
}