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