|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Developtech\AgilityBundle\Model; |
|
4
|
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
6
|
|
|
|
|
7
|
|
|
use Symfony\Component\Security\Core\User\UserInterface; |
|
8
|
|
|
|
|
9
|
|
|
/** |
|
10
|
|
|
* FeedbackModel |
|
11
|
|
|
* |
|
12
|
|
|
* @ORM\Entity(repositoryClass="Developtech\AgilityBundle\Repository\FeedbackModelRepository") |
|
13
|
|
|
* @ORM\HasLifecycleCallbacks() |
|
14
|
|
|
*/ |
|
15
|
|
|
class FeedbackModel |
|
16
|
|
|
{ |
|
17
|
|
|
/** |
|
18
|
|
|
* @var int |
|
19
|
|
|
* |
|
20
|
|
|
* @ORM\Column(name="id", type="integer") |
|
21
|
|
|
* @ORM\Id |
|
22
|
|
|
* @ORM\GeneratedValue(strategy="AUTO") |
|
23
|
|
|
*/ |
|
24
|
|
|
protected $id; |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* @var string |
|
28
|
|
|
* |
|
29
|
|
|
* @ORM\Column(name="name", type="string", length=125) |
|
30
|
|
|
*/ |
|
31
|
|
|
protected $name; |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* @var string |
|
35
|
|
|
* |
|
36
|
|
|
* @ORM\Column(name="slug", type="string", length=125) |
|
37
|
|
|
*/ |
|
38
|
|
|
protected $slug; |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* @var string |
|
42
|
|
|
* |
|
43
|
|
|
* @ORM\Column(name="description", type="string", length=255) |
|
44
|
|
|
*/ |
|
45
|
|
|
protected $description; |
|
46
|
|
|
|
|
47
|
|
|
/** |
|
48
|
|
|
* @var ProjectModel |
|
49
|
|
|
* |
|
50
|
|
|
* This field must be mapped by the end-user to the Project extended class |
|
51
|
|
|
*/ |
|
52
|
|
|
protected $project; |
|
53
|
|
|
|
|
54
|
|
|
/** |
|
55
|
|
|
* @var UserInterface |
|
56
|
|
|
* |
|
57
|
|
|
* This field must be mapped by the end-user |
|
58
|
|
|
*/ |
|
59
|
|
|
protected $author; |
|
60
|
|
|
|
|
61
|
|
|
/** |
|
62
|
|
|
* @var int |
|
63
|
|
|
* |
|
64
|
|
|
* @ORM\Column(name="status", type="integer") |
|
65
|
|
|
*/ |
|
66
|
|
|
protected $status; |
|
67
|
|
|
|
|
68
|
|
|
/** |
|
69
|
|
|
* @var UserInterface |
|
70
|
|
|
* |
|
71
|
|
|
* This field must be mapped by the end-user |
|
72
|
|
|
*/ |
|
73
|
|
|
protected $developer; |
|
74
|
|
|
|
|
75
|
|
|
/** |
|
76
|
|
|
* @var \DateTime |
|
77
|
|
|
* |
|
78
|
|
|
* @ORM\Column(name="createdAt", type="datetime") |
|
79
|
|
|
*/ |
|
80
|
|
|
protected $createdAt; |
|
81
|
|
|
|
|
82
|
|
|
/** |
|
83
|
|
|
* @var \DateTime |
|
84
|
|
|
* |
|
85
|
|
|
* @ORM\Column(name="updatedAt", type="datetime") |
|
86
|
|
|
*/ |
|
87
|
|
|
protected $updatedAt; |
|
88
|
|
|
|
|
89
|
|
|
const STATUS_OPEN = 0; |
|
90
|
|
|
const STATUS_TO_DO = 1; |
|
91
|
|
|
const STATUS_IN_PROGRESS = 2; |
|
92
|
|
|
const STATUS_TO_VALIDATE = 3; |
|
93
|
|
|
const STATUS_DONE = 4; |
|
94
|
|
|
const STATUS_CLOSED = 5; |
|
95
|
|
|
|
|
96
|
|
|
/** |
|
97
|
|
|
* @ORM\PrePersist() |
|
98
|
|
|
*/ |
|
99
|
|
|
public function prePersist() { |
|
100
|
|
|
$this->createdAt = $this->updatedAt = new \DateTime(); |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
/** |
|
104
|
|
|
* @ORM\PreUpdate() |
|
105
|
|
|
*/ |
|
106
|
|
|
public function preUpdate() { |
|
107
|
|
|
$this->updatedAt = new \DateTime(); |
|
108
|
|
|
} |
|
109
|
|
|
|
|
110
|
|
|
/** |
|
111
|
|
|
* @param integer $id |
|
112
|
|
|
* @return FeedbackModel |
|
113
|
|
|
*/ |
|
114
|
|
|
public function setId($id) { |
|
115
|
|
|
$this->id = $id; |
|
116
|
|
|
|
|
117
|
|
|
return $this; |
|
118
|
|
|
} |
|
119
|
|
|
|
|
120
|
|
|
/** |
|
121
|
|
|
* Get id |
|
122
|
|
|
* |
|
123
|
|
|
* @return int |
|
124
|
|
|
*/ |
|
125
|
|
|
public function getId() |
|
126
|
|
|
{ |
|
127
|
|
|
return $this->id; |
|
128
|
|
|
} |
|
129
|
|
|
|
|
130
|
|
|
/** |
|
131
|
|
|
* Set name |
|
132
|
|
|
* |
|
133
|
|
|
* @param string $name |
|
134
|
|
|
* |
|
135
|
|
|
* @return FeedbackModel |
|
136
|
|
|
*/ |
|
137
|
|
|
public function setName($name) |
|
138
|
|
|
{ |
|
139
|
|
|
$this->name = $name; |
|
140
|
|
|
|
|
141
|
|
|
return $this; |
|
142
|
|
|
} |
|
143
|
|
|
|
|
144
|
|
|
/** |
|
145
|
|
|
* Get name |
|
146
|
|
|
* |
|
147
|
|
|
* @return string |
|
148
|
|
|
*/ |
|
149
|
|
|
public function getName() |
|
150
|
|
|
{ |
|
151
|
|
|
return $this->name; |
|
152
|
|
|
} |
|
153
|
|
|
|
|
154
|
|
|
/** |
|
155
|
|
|
* Set slug |
|
156
|
|
|
* |
|
157
|
|
|
* @param string $slug |
|
158
|
|
|
* |
|
159
|
|
|
* @return FeedbackModel |
|
160
|
|
|
*/ |
|
161
|
|
|
public function setSlug($slug) |
|
162
|
|
|
{ |
|
163
|
|
|
$this->slug = $slug; |
|
164
|
|
|
|
|
165
|
|
|
return $this; |
|
166
|
|
|
} |
|
167
|
|
|
|
|
168
|
|
|
/** |
|
169
|
|
|
* Get slug |
|
170
|
|
|
* |
|
171
|
|
|
* @return string |
|
172
|
|
|
*/ |
|
173
|
|
|
public function getSlug() |
|
174
|
|
|
{ |
|
175
|
|
|
return $this->slug; |
|
176
|
|
|
} |
|
177
|
|
|
|
|
178
|
|
|
/** |
|
179
|
|
|
* Set description |
|
180
|
|
|
* |
|
181
|
|
|
* @param string $description |
|
182
|
|
|
* |
|
183
|
|
|
* @return FeedbackModel |
|
184
|
|
|
*/ |
|
185
|
|
|
public function setDescription($description) |
|
186
|
|
|
{ |
|
187
|
|
|
$this->description = $description; |
|
188
|
|
|
|
|
189
|
|
|
return $this; |
|
190
|
|
|
} |
|
191
|
|
|
|
|
192
|
|
|
/** |
|
193
|
|
|
* Get description |
|
194
|
|
|
* |
|
195
|
|
|
* @return string |
|
196
|
|
|
*/ |
|
197
|
|
|
public function getDescription() |
|
198
|
|
|
{ |
|
199
|
|
|
return $this->description; |
|
200
|
|
|
} |
|
201
|
|
|
|
|
202
|
|
|
/** |
|
203
|
|
|
* Set project |
|
204
|
|
|
* |
|
205
|
|
|
* @param ProjectModel $project |
|
206
|
|
|
* |
|
207
|
|
|
* @return FeedbackModel |
|
208
|
|
|
*/ |
|
209
|
|
|
public function setProject(ProjectModel $project) |
|
210
|
|
|
{ |
|
211
|
|
|
$this->project = $project; |
|
212
|
|
|
|
|
213
|
|
|
return $this; |
|
214
|
|
|
} |
|
215
|
|
|
|
|
216
|
|
|
/** |
|
217
|
|
|
* Get project |
|
218
|
|
|
* |
|
219
|
|
|
* @return ProjectModel |
|
220
|
|
|
*/ |
|
221
|
|
|
public function getProject() |
|
222
|
|
|
{ |
|
223
|
|
|
return $this->project; |
|
224
|
|
|
} |
|
225
|
|
|
|
|
226
|
|
|
/** |
|
227
|
|
|
* Set author |
|
228
|
|
|
* |
|
229
|
|
|
* @param UserInterface $author |
|
230
|
|
|
* |
|
231
|
|
|
* @return FeedbackModel |
|
232
|
|
|
*/ |
|
233
|
|
|
public function setAuthor(UserInterface $author) |
|
234
|
|
|
{ |
|
235
|
|
|
$this->author = $author; |
|
236
|
|
|
|
|
237
|
|
|
return $this; |
|
238
|
|
|
} |
|
239
|
|
|
|
|
240
|
|
|
/** |
|
241
|
|
|
* Get author |
|
242
|
|
|
* |
|
243
|
|
|
* @return UserInterface |
|
244
|
|
|
*/ |
|
245
|
|
|
public function getAuthor() |
|
246
|
|
|
{ |
|
247
|
|
|
return $this->author; |
|
248
|
|
|
} |
|
249
|
|
|
|
|
250
|
|
|
/** |
|
251
|
|
|
* Set status |
|
252
|
|
|
* |
|
253
|
|
|
* @param integer $status |
|
254
|
|
|
* |
|
255
|
|
|
* @return FeedbackModel |
|
256
|
|
|
*/ |
|
257
|
|
|
public function setStatus($status) |
|
258
|
|
|
{ |
|
259
|
|
|
$this->status = $status; |
|
260
|
|
|
|
|
261
|
|
|
return $this; |
|
262
|
|
|
} |
|
263
|
|
|
|
|
264
|
|
|
/** |
|
265
|
|
|
* Get status |
|
266
|
|
|
* |
|
267
|
|
|
* @return int |
|
268
|
|
|
*/ |
|
269
|
|
|
public function getStatus() |
|
270
|
|
|
{ |
|
271
|
|
|
return $this->status; |
|
272
|
|
|
} |
|
273
|
|
|
|
|
274
|
|
|
/** |
|
275
|
|
|
* Set developer |
|
276
|
|
|
* |
|
277
|
|
|
* @param UserInterface $developer |
|
278
|
|
|
* |
|
279
|
|
|
* @return FeedbackModel |
|
280
|
|
|
*/ |
|
281
|
|
|
public function setDeveloper(UserInterface $developer) |
|
282
|
|
|
{ |
|
283
|
|
|
$this->developer = $developer; |
|
284
|
|
|
|
|
285
|
|
|
return $this; |
|
286
|
|
|
} |
|
287
|
|
|
|
|
288
|
|
|
/** |
|
289
|
|
|
* Get developer |
|
290
|
|
|
* |
|
291
|
|
|
* @return UserInterface |
|
292
|
|
|
*/ |
|
293
|
|
|
public function getDeveloper() |
|
294
|
|
|
{ |
|
295
|
|
|
return $this->developer; |
|
296
|
|
|
} |
|
297
|
|
|
|
|
298
|
|
|
/** |
|
299
|
|
|
* Set createdAt |
|
300
|
|
|
* |
|
301
|
|
|
* @param \DateTime $createdAt |
|
302
|
|
|
* |
|
303
|
|
|
* @return FeedbackModel |
|
304
|
|
|
*/ |
|
305
|
|
|
public function setCreatedAt($createdAt) |
|
306
|
|
|
{ |
|
307
|
|
|
$this->createdAt = $createdAt; |
|
308
|
|
|
|
|
309
|
|
|
return $this; |
|
310
|
|
|
} |
|
311
|
|
|
|
|
312
|
|
|
/** |
|
313
|
|
|
* Get createdAt |
|
314
|
|
|
* |
|
315
|
|
|
* @return \DateTime |
|
316
|
|
|
*/ |
|
317
|
|
|
public function getCreatedAt() |
|
318
|
|
|
{ |
|
319
|
|
|
return $this->createdAt; |
|
320
|
|
|
} |
|
321
|
|
|
|
|
322
|
|
|
/** |
|
323
|
|
|
* Set updatedAt |
|
324
|
|
|
* |
|
325
|
|
|
* @param \DateTime $updatedAt |
|
326
|
|
|
* |
|
327
|
|
|
* @return FeedbackModel |
|
328
|
|
|
*/ |
|
329
|
|
|
public function setUpdatedAt($updatedAt) |
|
330
|
|
|
{ |
|
331
|
|
|
$this->updatedAt = $updatedAt; |
|
332
|
|
|
|
|
333
|
|
|
return $this; |
|
334
|
|
|
} |
|
335
|
|
|
|
|
336
|
|
|
/** |
|
337
|
|
|
* Get updatedAt |
|
338
|
|
|
* |
|
339
|
|
|
* @return \DateTime |
|
340
|
|
|
*/ |
|
341
|
|
|
public function getUpdatedAt() |
|
342
|
|
|
{ |
|
343
|
|
|
return $this->updatedAt; |
|
344
|
|
|
} |
|
345
|
|
|
} |
|
346
|
|
|
|