1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Azine\EmailBundle\Entity; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* Notification. |
7
|
|
|
*/ |
8
|
|
|
class Notification |
9
|
|
|
{ |
10
|
|
|
const IMPORTANCE_LOW = 1; |
11
|
|
|
const IMPORTANCE_NORMAL = 2; |
12
|
|
|
const IMPORTANCE_HIGH = 3; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* Initialize the created-date with "now". |
16
|
|
|
*/ |
17
|
1 |
|
public function setCreatedValue() |
18
|
|
|
{ |
19
|
1 |
|
$this->created = new \DateTime(); |
20
|
1 |
|
} |
21
|
|
|
|
22
|
|
|
/////////////////////////////////////////////////////////////////// |
23
|
|
|
// generated stuff only below this line. |
24
|
|
|
// @codeCoverageIgnoreStart |
25
|
|
|
/////////////////////////////////////////////////////////////////// |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @var int |
29
|
|
|
*/ |
30
|
|
|
private $id; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @var int |
34
|
|
|
*/ |
35
|
|
|
private $recipient_id; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @var string |
39
|
|
|
*/ |
40
|
|
|
private $title; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @var string |
44
|
|
|
*/ |
45
|
|
|
private $content; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @var string |
49
|
|
|
*/ |
50
|
|
|
private $template; |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @var bool |
54
|
|
|
*/ |
55
|
|
|
private $send_immediately; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @var int |
59
|
|
|
*/ |
60
|
|
|
private $importance; |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @var \DateTime |
64
|
|
|
*/ |
65
|
|
|
private $sent; |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* @var \DateTime |
69
|
|
|
*/ |
70
|
|
|
private $created; |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* Get id. |
74
|
|
|
* |
75
|
|
|
* @return int |
76
|
|
|
*/ |
77
|
|
|
public function getId() |
78
|
|
|
{ |
79
|
|
|
return $this->id; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* Set recipient_id. |
84
|
|
|
* |
85
|
|
|
* @param int $recipientId |
86
|
|
|
* |
87
|
|
|
* @return Notification |
88
|
|
|
*/ |
89
|
|
|
public function setRecipientId($recipientId) |
90
|
|
|
{ |
91
|
|
|
$this->recipient_id = $recipientId; |
92
|
|
|
|
93
|
|
|
return $this; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* Get recipient_id. |
98
|
|
|
* |
99
|
|
|
* @return int |
100
|
|
|
*/ |
101
|
|
|
public function getRecipientId() |
102
|
|
|
{ |
103
|
|
|
return $this->recipient_id; |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
/** |
107
|
|
|
* Set title. |
108
|
|
|
* |
109
|
|
|
* @param string $title |
110
|
|
|
* |
111
|
|
|
* @return Notification |
112
|
|
|
*/ |
113
|
|
|
public function setTitle($title) |
114
|
|
|
{ |
115
|
|
|
$this->title = $title; |
116
|
|
|
|
117
|
|
|
return $this; |
118
|
|
|
} |
119
|
|
|
|
120
|
|
|
/** |
121
|
|
|
* Get title. |
122
|
|
|
* |
123
|
|
|
* @return string |
124
|
|
|
*/ |
125
|
|
|
public function getTitle() |
126
|
|
|
{ |
127
|
|
|
return $this->title; |
128
|
|
|
} |
129
|
|
|
|
130
|
|
|
/** |
131
|
|
|
* Set content. |
132
|
|
|
* |
133
|
|
|
* @param string $content |
134
|
|
|
* |
135
|
|
|
* @return Notification |
136
|
|
|
*/ |
137
|
|
|
public function setContent($content) |
138
|
|
|
{ |
139
|
|
|
$this->content = $content; |
140
|
|
|
|
141
|
|
|
return $this; |
142
|
|
|
} |
143
|
|
|
|
144
|
|
|
/** |
145
|
|
|
* Get content. |
146
|
|
|
* |
147
|
|
|
* @return string |
148
|
|
|
*/ |
149
|
|
|
public function getContent() |
150
|
|
|
{ |
151
|
|
|
return $this->content; |
152
|
|
|
} |
153
|
|
|
|
154
|
|
|
/** |
155
|
|
|
* Set template. |
156
|
|
|
* |
157
|
|
|
* @param string $template |
158
|
|
|
* |
159
|
|
|
* @return Notification |
160
|
|
|
*/ |
161
|
|
|
public function setTemplate($template) |
162
|
|
|
{ |
163
|
|
|
$this->template = $template; |
164
|
|
|
|
165
|
|
|
return $this; |
166
|
|
|
} |
167
|
|
|
|
168
|
|
|
/** |
169
|
|
|
* Get template. |
170
|
|
|
* |
171
|
|
|
* @return string |
172
|
|
|
*/ |
173
|
|
|
public function getTemplate() |
174
|
|
|
{ |
175
|
|
|
return $this->template; |
176
|
|
|
} |
177
|
|
|
|
178
|
|
|
/** |
179
|
|
|
* Set send_immediately. |
180
|
|
|
* |
181
|
|
|
* @param bool $sendImmediately |
182
|
|
|
* |
183
|
|
|
* @return Notification |
184
|
|
|
*/ |
185
|
|
|
public function setSendImmediately($sendImmediately) |
186
|
|
|
{ |
187
|
|
|
$this->send_immediately = $sendImmediately; |
188
|
|
|
|
189
|
|
|
return $this; |
190
|
|
|
} |
191
|
|
|
|
192
|
|
|
/** |
193
|
|
|
* Get send_immediately. |
194
|
|
|
* |
195
|
|
|
* @return bool |
196
|
|
|
*/ |
197
|
|
|
public function getSendImmediately() |
198
|
|
|
{ |
199
|
|
|
return $this->send_immediately; |
200
|
|
|
} |
201
|
|
|
|
202
|
|
|
/** |
203
|
|
|
* Set importance. |
204
|
|
|
* |
205
|
|
|
* @param int $importance |
206
|
|
|
* |
207
|
|
|
* @return Notification |
208
|
|
|
*/ |
209
|
|
|
public function setImportance($importance) |
210
|
|
|
{ |
211
|
|
|
$this->importance = $importance; |
212
|
|
|
|
213
|
|
|
return $this; |
214
|
|
|
} |
215
|
|
|
|
216
|
|
|
/** |
217
|
|
|
* Get importance. |
218
|
|
|
* |
219
|
|
|
* @return int |
220
|
|
|
*/ |
221
|
|
|
public function getImportance() |
222
|
|
|
{ |
223
|
|
|
return $this->importance; |
224
|
|
|
} |
225
|
|
|
|
226
|
|
|
/** |
227
|
|
|
* Set sent. |
228
|
|
|
* |
229
|
|
|
* @param \DateTime $sent |
230
|
|
|
* |
231
|
|
|
* @return Notification |
232
|
|
|
*/ |
233
|
|
|
public function setSent($sent) |
234
|
|
|
{ |
235
|
|
|
$this->sent = $sent; |
236
|
|
|
|
237
|
|
|
return $this; |
238
|
|
|
} |
239
|
|
|
|
240
|
|
|
/** |
241
|
|
|
* Get sent. |
242
|
|
|
* |
243
|
|
|
* @return \DateTime |
244
|
|
|
*/ |
245
|
|
|
public function getSent() |
246
|
|
|
{ |
247
|
|
|
return $this->sent; |
248
|
|
|
} |
249
|
|
|
|
250
|
|
|
/** |
251
|
|
|
* Set created. |
252
|
|
|
* |
253
|
|
|
* @param \DateTime $created |
254
|
|
|
* |
255
|
|
|
* @return Notification |
256
|
|
|
*/ |
257
|
|
|
public function setCreated($created) |
258
|
|
|
{ |
259
|
|
|
$this->created = $created; |
260
|
|
|
|
261
|
|
|
return $this; |
262
|
|
|
} |
263
|
|
|
|
264
|
|
|
/** |
265
|
|
|
* Get created. |
266
|
|
|
* |
267
|
|
|
* @return \DateTime |
268
|
|
|
*/ |
269
|
|
|
public function getCreated() |
270
|
|
|
{ |
271
|
|
|
return $this->created; |
272
|
|
|
} |
273
|
|
|
|
274
|
|
|
/** |
275
|
|
|
* @var array |
276
|
|
|
*/ |
277
|
|
|
private $variables; |
278
|
|
|
|
279
|
|
|
/** |
280
|
|
|
* Set variables. |
281
|
|
|
* |
282
|
|
|
* @param array $variables |
283
|
|
|
* |
284
|
|
|
* @return Notification |
285
|
|
|
*/ |
286
|
|
|
public function setVariables($variables) |
287
|
|
|
{ |
288
|
|
|
$this->variables = $variables; |
289
|
|
|
|
290
|
|
|
return $this; |
291
|
|
|
} |
292
|
|
|
|
293
|
|
|
/** |
294
|
|
|
* Get variables. |
295
|
|
|
* |
296
|
|
|
* @return array |
297
|
|
|
*/ |
298
|
|
|
public function getVariables() |
299
|
|
|
{ |
300
|
|
|
return $this->variables; |
301
|
|
|
} |
302
|
|
|
} |
303
|
|
|
|