1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Developtech\AgilityBundle\Model; |
4
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
6
|
|
|
|
7
|
|
|
use Doctrine\Common\Collections\ArrayCollection; |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* Project |
11
|
|
|
* |
12
|
|
|
* @ORM\Entity(repositoryClass="Developtech\AgilityBundle\Repository\ProjectRepository") |
13
|
|
|
* @ORM\HasLifecycleCallbacks() |
14
|
|
|
*/ |
15
|
|
|
abstract class ProjectModel |
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, unique=true) |
30
|
|
|
*/ |
31
|
|
|
protected $name; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var string |
35
|
|
|
* |
36
|
|
|
* @ORM\Column(name="slug", type="string", length=125, unique=true) |
37
|
|
|
*/ |
38
|
|
|
protected $slug; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @var \DateTime |
42
|
|
|
* |
43
|
|
|
* @ORM\Column(name="created_at", type="datetime") |
44
|
|
|
*/ |
45
|
|
|
protected $createdAt; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @var int |
49
|
|
|
* |
50
|
|
|
* @ORM\Column(name="nbBetaTesters", type="integer") |
51
|
|
|
*/ |
52
|
|
|
protected $nbBetaTesters; |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @var string |
56
|
|
|
* |
57
|
|
|
* @ORM\Column(name="betaTestStatus", type="string", length=12) |
58
|
|
|
*/ |
59
|
|
|
protected $betaTestStatus; |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* @var object |
63
|
|
|
* |
64
|
|
|
* The mapping to the user class must be done by the end-user |
65
|
|
|
*/ |
66
|
|
|
protected $productOwner; |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @var ArrayCollection |
70
|
|
|
* |
71
|
|
|
* The mapping to the features can be done by the end-user but is optionnal |
72
|
|
|
*/ |
73
|
|
|
protected $features; |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* @var ArrayCollection |
77
|
|
|
* |
78
|
|
|
* The mapping to the feedbacks can be done by the end-user but is optionnal |
79
|
|
|
*/ |
80
|
|
|
protected $feedbacks; |
81
|
|
|
|
82
|
10 |
|
public function __construct() { |
83
|
|
|
$this->features = new ArrayCollection(); |
84
|
|
|
$this->feedbacks = new ArrayCollection(); |
85
|
10 |
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* @param integer $id |
89
|
|
|
* @return Project |
90
|
|
|
*/ |
91
|
3 |
|
public function setId($id) { |
92
|
3 |
|
$this->id = $id; |
93
|
|
|
|
94
|
3 |
|
return $this; |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* @ORM\PrePersist() |
99
|
|
|
*/ |
100
|
|
|
public function prePersist() { |
101
|
|
|
$this->createdAt = new \DateTime(); |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* Get id |
106
|
|
|
* |
107
|
|
|
* @return int |
108
|
|
|
*/ |
109
|
3 |
|
public function getId() |
110
|
|
|
{ |
111
|
3 |
|
return $this->id; |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* Set name |
116
|
|
|
* |
117
|
|
|
* @param string $name |
118
|
|
|
* |
119
|
|
|
* @return ProjectModel |
120
|
|
|
*/ |
121
|
3 |
|
public function setName($name) |
122
|
|
|
{ |
123
|
3 |
|
$this->name = $name; |
124
|
|
|
|
125
|
3 |
|
return $this; |
126
|
|
|
} |
127
|
|
|
|
128
|
|
|
/** |
129
|
|
|
* Get name |
130
|
|
|
* |
131
|
|
|
* @return string |
132
|
|
|
*/ |
133
|
4 |
|
public function getName() |
134
|
|
|
{ |
135
|
4 |
|
return $this->name; |
136
|
|
|
} |
137
|
|
|
|
138
|
|
|
/** |
139
|
|
|
* Set slug |
140
|
|
|
* |
141
|
|
|
* @param string $slug |
142
|
|
|
* |
143
|
|
|
* @return ProjectModel |
144
|
|
|
*/ |
145
|
3 |
|
public function setSlug($slug) |
146
|
|
|
{ |
147
|
3 |
|
$this->slug = $slug; |
148
|
|
|
|
149
|
3 |
|
return $this; |
150
|
|
|
} |
151
|
|
|
|
152
|
|
|
/** |
153
|
|
|
* Get slug |
154
|
|
|
* |
155
|
|
|
* @return string |
156
|
|
|
*/ |
157
|
4 |
|
public function getSlug() |
158
|
|
|
{ |
159
|
4 |
|
return $this->slug; |
160
|
|
|
} |
161
|
|
|
|
162
|
|
|
/** |
163
|
|
|
* Set createdAt |
164
|
|
|
* |
165
|
|
|
* @param \DateTime $createdAt |
166
|
|
|
* |
167
|
|
|
* @return ProjectModel |
168
|
|
|
*/ |
169
|
3 |
|
public function setCreatedAt($createdAt) |
170
|
|
|
{ |
171
|
3 |
|
$this->createdAt = $createdAt; |
172
|
|
|
|
173
|
3 |
|
return $this; |
174
|
|
|
} |
175
|
|
|
|
176
|
|
|
/** |
177
|
|
|
* Get createdAt |
178
|
|
|
* |
179
|
|
|
* @return \DateTime |
180
|
|
|
*/ |
181
|
1 |
|
public function getCreatedAt() |
182
|
|
|
{ |
183
|
1 |
|
return $this->createdAt; |
184
|
|
|
} |
185
|
|
|
|
186
|
|
|
/** |
187
|
|
|
* Set nbBetaTesters |
188
|
|
|
* |
189
|
|
|
* @param integer $nbBetaTesters |
190
|
|
|
* |
191
|
|
|
* @return ProjectModel |
192
|
|
|
*/ |
193
|
3 |
|
public function setNbBetaTesters($nbBetaTesters) |
194
|
|
|
{ |
195
|
3 |
|
$this->nbBetaTesters = $nbBetaTesters; |
196
|
|
|
|
197
|
3 |
|
return $this; |
198
|
|
|
} |
199
|
|
|
|
200
|
|
|
/** |
201
|
|
|
* Get nbBetaTesters |
202
|
|
|
* |
203
|
|
|
* @return int |
204
|
|
|
*/ |
205
|
2 |
|
public function getNbBetaTesters() |
206
|
|
|
{ |
207
|
2 |
|
return $this->nbBetaTesters; |
208
|
|
|
} |
209
|
|
|
|
210
|
|
|
/** |
211
|
|
|
* Set betaTestStatus |
212
|
|
|
* |
213
|
|
|
* @param string $betaTestStatus |
214
|
|
|
* |
215
|
|
|
* @return ProjectModel |
216
|
|
|
*/ |
217
|
3 |
|
public function setBetaTestStatus($betaTestStatus) |
218
|
|
|
{ |
219
|
3 |
|
$this->betaTestStatus = $betaTestStatus; |
220
|
|
|
|
221
|
3 |
|
return $this; |
222
|
|
|
} |
223
|
|
|
|
224
|
|
|
/** |
225
|
|
|
* Get betaTestStatus |
226
|
|
|
* |
227
|
|
|
* @return string |
228
|
|
|
*/ |
229
|
2 |
|
public function getBetaTestStatus() |
230
|
|
|
{ |
231
|
2 |
|
return $this->betaTestStatus; |
232
|
|
|
} |
233
|
|
|
|
234
|
|
|
/** |
235
|
|
|
* Set productOwner |
236
|
|
|
* |
237
|
|
|
* @param object $productOwner |
238
|
|
|
* |
239
|
|
|
* @return ProjectModel |
240
|
|
|
*/ |
241
|
4 |
|
public function setProductOwner($productOwner) |
242
|
|
|
{ |
243
|
4 |
|
$this->productOwner = $productOwner; |
244
|
|
|
|
245
|
4 |
|
return $this; |
246
|
|
|
} |
247
|
|
|
|
248
|
|
|
/** |
249
|
|
|
* Get productOwner |
250
|
|
|
* |
251
|
|
|
* @return object |
252
|
|
|
*/ |
253
|
2 |
|
public function getProductOwner() |
254
|
|
|
{ |
255
|
2 |
|
return $this->productOwner; |
256
|
|
|
} |
257
|
|
|
|
258
|
|
|
/** |
259
|
|
|
* @param FeatureModel $feature |
260
|
|
|
* @return ProjectModel |
261
|
|
|
*/ |
262
|
1 |
|
public function addFeature(FeatureModel $feature) { |
263
|
|
|
$this->features->add($feature); |
264
|
|
|
|
265
|
1 |
|
return $this; |
266
|
1 |
|
} |
267
|
|
|
|
268
|
|
|
/** |
269
|
|
|
* @param FeatureModel $feature |
270
|
|
|
* @return ProjectModel |
271
|
|
|
*/ |
272
|
1 |
|
public function removeFeature(FeatureModel $feature) { |
273
|
|
|
$this->features->removeElement($feature); |
274
|
|
|
|
275
|
1 |
|
return $this; |
276
|
1 |
|
} |
277
|
|
|
|
278
|
|
|
/** |
279
|
|
|
* @param FeatureModel $feature |
280
|
|
|
* @return boolean |
281
|
|
|
*/ |
282
|
1 |
|
public function hasFeature(FeatureModel $feature) { |
283
|
|
|
return $this->features->contains($feature); |
284
|
1 |
|
} |
285
|
|
|
|
286
|
|
|
/** |
287
|
|
|
* @return ArrayCollection |
288
|
|
|
*/ |
289
|
1 |
|
public function getFeatures() { |
290
|
1 |
|
return $this->features; |
291
|
|
|
} |
292
|
|
|
|
293
|
|
|
/** |
294
|
|
|
* @param FeedbackModel $feedback |
295
|
|
|
* @return ProjectModel |
296
|
|
|
*/ |
297
|
|
|
public function addFeedback(FeedbackModel $feedback) { |
298
|
|
|
$this->feedbacks->add($feedback); |
299
|
|
|
|
300
|
|
|
return $this; |
301
|
|
|
} |
302
|
|
|
|
303
|
|
|
/** |
304
|
|
|
* @param FeedbackModel $feedback |
305
|
|
|
* @return ProjectModel |
306
|
|
|
*/ |
307
|
1 |
|
public function removeFeedback(FeedbackModel $feedback) { |
308
|
|
|
$this->feedbacks->removeElement($feedback); |
309
|
|
|
|
310
|
1 |
|
return $this; |
311
|
1 |
|
} |
312
|
|
|
|
313
|
|
|
/** |
314
|
|
|
* @param FeedbackModel $feedback |
315
|
|
|
* @return boolean |
316
|
|
|
*/ |
317
|
1 |
|
public function hasFeedback(FeedbackModel $feedback) { |
318
|
|
|
return $this->feedbacks->contains($feedback); |
319
|
1 |
|
} |
320
|
|
|
|
321
|
|
|
/** |
322
|
|
|
* @return ArrayCollection |
323
|
|
|
*/ |
324
|
1 |
|
public function getFeedbacks() { |
325
|
1 |
|
return $this->feedbacks; |
326
|
|
|
} |
327
|
|
|
} |
328
|
|
|
|