|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Yokai\MessengerBundle; |
|
4
|
|
|
|
|
5
|
|
|
use Symfony\Component\HttpFoundation\File\File; |
|
6
|
|
|
|
|
7
|
|
|
/** |
|
8
|
|
|
* @author Yann Eugoné <[email protected]> |
|
9
|
|
|
*/ |
|
10
|
|
|
class Delivery |
|
11
|
|
|
{ |
|
12
|
|
|
/** |
|
13
|
|
|
* @var string |
|
14
|
|
|
*/ |
|
15
|
|
|
private $message; |
|
16
|
|
|
|
|
17
|
|
|
/** |
|
18
|
|
|
* @var mixed |
|
19
|
|
|
*/ |
|
20
|
|
|
private $recipient; |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* @var array |
|
24
|
|
|
*/ |
|
25
|
|
|
private $options; |
|
26
|
|
|
|
|
27
|
|
|
/** |
|
28
|
|
|
* @var string |
|
29
|
|
|
*/ |
|
30
|
|
|
private $subject; |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* @var string |
|
34
|
|
|
*/ |
|
35
|
|
|
private $body; |
|
36
|
|
|
|
|
37
|
|
|
/** |
|
38
|
|
|
* @var array |
|
39
|
|
|
*/ |
|
40
|
|
|
private $parameters; |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* @var array |
|
44
|
|
|
*/ |
|
45
|
|
|
private $attachments; |
|
46
|
|
|
|
|
47
|
|
|
/** |
|
48
|
|
|
* @param string $message |
|
49
|
|
|
* @param mixed $recipient |
|
50
|
|
|
* @param array $options |
|
51
|
|
|
* @param string $subject |
|
52
|
|
|
* @param string $body |
|
53
|
|
|
* @param array $parameters |
|
54
|
|
|
* @param File[] $attachments |
|
55
|
|
|
*/ |
|
56
|
18 |
|
public function __construct( |
|
57
|
|
|
$message, |
|
58
|
|
|
$recipient, |
|
59
|
|
|
array $options, |
|
60
|
|
|
$subject, |
|
61
|
|
|
$body, |
|
62
|
|
|
array $parameters, |
|
63
|
|
|
array $attachments |
|
64
|
|
|
) { |
|
65
|
18 |
|
$this->message = $message; |
|
66
|
18 |
|
$this->recipient = $recipient; |
|
67
|
18 |
|
$this->options = $options; |
|
68
|
18 |
|
$this->subject = $subject; |
|
69
|
18 |
|
$this->body = $body; |
|
70
|
18 |
|
$this->parameters = $parameters; |
|
71
|
18 |
|
$this->attachments = $attachments; |
|
72
|
18 |
|
} |
|
73
|
|
|
|
|
74
|
|
|
/** |
|
75
|
|
|
* @return string |
|
76
|
|
|
*/ |
|
77
|
2 |
|
public function getMessage() |
|
78
|
|
|
{ |
|
79
|
2 |
|
return $this->message; |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
/** |
|
83
|
|
|
* @return mixed |
|
84
|
|
|
*/ |
|
85
|
12 |
|
public function getRecipient() |
|
86
|
|
|
{ |
|
87
|
12 |
|
return $this->recipient; |
|
88
|
|
|
} |
|
89
|
|
|
|
|
90
|
|
|
/** |
|
91
|
|
|
* @return array |
|
92
|
|
|
*/ |
|
93
|
15 |
|
public function getOptions() |
|
94
|
|
|
{ |
|
95
|
15 |
|
return $this->options; |
|
96
|
|
|
} |
|
97
|
|
|
|
|
98
|
|
|
/** |
|
99
|
|
|
* @return string |
|
100
|
|
|
*/ |
|
101
|
4 |
|
public function getSubject() |
|
102
|
|
|
{ |
|
103
|
4 |
|
return $this->subject; |
|
104
|
|
|
} |
|
105
|
|
|
|
|
106
|
|
|
/** |
|
107
|
|
|
* @return string |
|
108
|
|
|
*/ |
|
109
|
13 |
|
public function getBody() |
|
110
|
|
|
{ |
|
111
|
13 |
|
return $this->body; |
|
112
|
|
|
} |
|
113
|
|
|
|
|
114
|
|
|
/** |
|
115
|
|
|
* @return array |
|
116
|
|
|
*/ |
|
117
|
3 |
|
public function getParameters() |
|
118
|
|
|
{ |
|
119
|
3 |
|
return $this->parameters; |
|
120
|
|
|
} |
|
121
|
|
|
|
|
122
|
|
|
/** |
|
123
|
|
|
* @return File[] |
|
124
|
|
|
*/ |
|
125
|
1 |
|
public function getAttachments() |
|
126
|
|
|
{ |
|
127
|
1 |
|
return $this->attachments; |
|
128
|
|
|
} |
|
129
|
|
|
} |
|
130
|
|
|
|