1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace TonicHealthCheck\Check\Email\Entity; |
4
|
|
|
|
5
|
|
|
use DateTime; |
6
|
|
|
use DateTimeInterface; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* Class EmailSendReceive |
10
|
|
|
* @package TonicHealthCheck\Check\Email\Entity |
11
|
|
|
*/ |
12
|
|
|
class EmailSendReceive |
13
|
|
|
{ |
14
|
|
|
const STATUS_CREATED = 'created'; |
15
|
|
|
const STATUS_SANDED = 'sanded'; |
16
|
|
|
const STATUS_SAND_ERROR = 'sand_error'; |
17
|
|
|
const STATUS_RECEIVED = 'received'; |
18
|
|
|
const STATUS_RECEIVED_ERROR = 'receive_error'; |
19
|
|
|
const STATUS_EXPIRED = 'expired'; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* @var DateTimeInterface |
23
|
|
|
*/ |
24
|
|
|
private $sentAt; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @var DateTimeInterface |
28
|
|
|
*/ |
29
|
|
|
private $receivedAt; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @var string |
33
|
|
|
*/ |
34
|
|
|
private $subject; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @var string |
38
|
|
|
*/ |
39
|
|
|
private $body; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @var string |
43
|
|
|
*/ |
44
|
|
|
private $from; |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @var string |
48
|
|
|
*/ |
49
|
|
|
private $to; |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* @var string |
53
|
|
|
*/ |
54
|
|
|
private $status = self::STATUS_CREATED; |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* Set sentAt |
58
|
|
|
* |
59
|
|
|
* @param \DateTime $sentAt |
60
|
|
|
* |
61
|
|
|
* @return EmailSendReceive |
62
|
|
|
*/ |
63
|
11 |
|
public function setSentAt($sentAt) |
64
|
|
|
{ |
65
|
11 |
|
$this->sentAt = $sentAt; |
66
|
|
|
|
67
|
11 |
|
return $this; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* Get sentAt |
72
|
|
|
* |
73
|
|
|
* @return \DateTime |
74
|
|
|
*/ |
75
|
9 |
|
public function getSentAt() |
76
|
|
|
{ |
77
|
9 |
|
return $this->sentAt; |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* Set receivedAt |
82
|
|
|
* |
83
|
|
|
* @param \DateTime $receivedAt |
84
|
|
|
* |
85
|
|
|
* @return EmailSendReceive |
86
|
|
|
*/ |
87
|
2 |
|
public function setReceivedAt($receivedAt) |
88
|
|
|
{ |
89
|
2 |
|
$this->receivedAt = $receivedAt; |
90
|
|
|
|
91
|
2 |
|
return $this; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* Get receivedAt |
96
|
|
|
* |
97
|
|
|
* @return \DateTime |
98
|
|
|
*/ |
99
|
1 |
|
public function getReceivedAt() |
100
|
|
|
{ |
101
|
1 |
|
return $this->receivedAt; |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* Set subject |
106
|
|
|
* |
107
|
|
|
* @param string $subject |
108
|
|
|
* |
109
|
|
|
* @return EmailSendReceive |
110
|
|
|
*/ |
111
|
6 |
|
public function setSubject($subject) |
112
|
|
|
{ |
113
|
6 |
|
$this->subject = $subject; |
114
|
|
|
|
115
|
6 |
|
return $this; |
116
|
|
|
} |
117
|
|
|
|
118
|
|
|
/** |
119
|
|
|
* Get subject |
120
|
|
|
* |
121
|
|
|
* @return string |
122
|
|
|
*/ |
123
|
10 |
|
public function getSubject() |
124
|
|
|
{ |
125
|
10 |
|
return $this->subject; |
126
|
|
|
} |
127
|
|
|
|
128
|
|
|
/** |
129
|
|
|
* Set body |
130
|
|
|
* |
131
|
|
|
* @param string $body |
132
|
|
|
* |
133
|
|
|
* @return EmailSendReceive |
134
|
|
|
*/ |
135
|
6 |
|
public function setBody($body) |
136
|
|
|
{ |
137
|
6 |
|
$this->body = $body; |
138
|
|
|
|
139
|
6 |
|
return $this; |
140
|
|
|
} |
141
|
|
|
|
142
|
|
|
/** |
143
|
|
|
* Get body |
144
|
|
|
* |
145
|
|
|
* @return string |
146
|
|
|
*/ |
147
|
6 |
|
public function getBody() |
148
|
|
|
{ |
149
|
6 |
|
return $this->body; |
150
|
|
|
} |
151
|
|
|
|
152
|
|
|
/** |
153
|
|
|
* Set from |
154
|
|
|
* |
155
|
|
|
* @param string $from |
156
|
|
|
* |
157
|
|
|
* @return EmailSendReceive |
158
|
|
|
*/ |
159
|
6 |
|
public function setFrom($from) |
160
|
|
|
{ |
161
|
6 |
|
$this->from = $from; |
162
|
|
|
|
163
|
6 |
|
return $this; |
164
|
|
|
} |
165
|
|
|
|
166
|
|
|
/** |
167
|
|
|
* Get from |
168
|
|
|
* |
169
|
|
|
* @return string |
170
|
|
|
*/ |
171
|
10 |
|
public function getFrom() |
172
|
|
|
{ |
173
|
10 |
|
return $this->from; |
174
|
|
|
} |
175
|
|
|
|
176
|
|
|
/** |
177
|
|
|
* Set to |
178
|
|
|
* |
179
|
|
|
* @param string $to |
180
|
|
|
* |
181
|
|
|
* @return EmailSendReceive |
182
|
|
|
*/ |
183
|
6 |
|
public function setTo($to) |
184
|
|
|
{ |
185
|
6 |
|
$this->to = $to; |
186
|
|
|
|
187
|
6 |
|
return $this; |
188
|
|
|
} |
189
|
|
|
|
190
|
|
|
/** |
191
|
|
|
* Get to |
192
|
|
|
* |
193
|
|
|
* @return string |
194
|
|
|
*/ |
195
|
6 |
|
public function getTo() |
196
|
|
|
{ |
197
|
6 |
|
return $this->to; |
198
|
|
|
} |
199
|
|
|
|
200
|
|
|
/** |
201
|
|
|
* Set status |
202
|
|
|
* |
203
|
|
|
* @param string $status |
204
|
|
|
* |
205
|
|
|
* @return EmailSendReceive |
206
|
|
|
*/ |
207
|
9 |
|
public function setStatus($status) |
208
|
|
|
{ |
209
|
9 |
|
$this->status = $status; |
210
|
|
|
|
211
|
9 |
|
return $this; |
212
|
|
|
} |
213
|
|
|
|
214
|
|
|
/** |
215
|
|
|
* Get status |
216
|
|
|
* |
217
|
|
|
* @return string |
218
|
|
|
*/ |
219
|
7 |
|
public function getStatus() |
220
|
|
|
{ |
221
|
7 |
|
return $this->status; |
222
|
|
|
} |
223
|
|
|
} |
224
|
|
|
|