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
|
|
|
abstract class ProjectModel |
13
|
|
|
{ |
14
|
|
|
/** @var string */ |
15
|
|
|
protected $name; |
16
|
|
|
/** @var string */ |
17
|
|
|
protected $slug; |
18
|
|
|
/** @var string **/ |
19
|
|
|
protected $description; |
20
|
|
|
/** @var \DateTime */ |
21
|
|
|
protected $createdAt; |
22
|
|
|
/** @var int */ |
23
|
|
|
protected $nbBetaTesters; |
24
|
|
|
/** @var string */ |
25
|
|
|
protected $betaTestStatus; |
26
|
|
|
/** |
27
|
|
|
* @var object |
28
|
|
|
* |
29
|
|
|
* The mapping to the user class must be done by the end-user |
30
|
|
|
*/ |
31
|
|
|
protected $productOwner; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var ArrayCollection |
35
|
|
|
* |
36
|
|
|
* The mapping to the features can be done by the end-user but is optionnal |
37
|
|
|
*/ |
38
|
|
|
protected $features; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @var ArrayCollection |
42
|
|
|
* |
43
|
|
|
* The mapping to the feedbacks can be done by the end-user but is optionnal |
44
|
|
|
*/ |
45
|
|
|
protected $feedbacks; |
46
|
|
|
|
47
|
|
|
public function __construct() { |
48
|
|
|
$this->features = new ArrayCollection(); |
49
|
|
|
$this->feedbacks = new ArrayCollection(); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* Set name |
54
|
|
|
* |
55
|
|
|
* @param string $name |
56
|
|
|
* |
57
|
|
|
* @return ProjectModel |
58
|
|
|
*/ |
59
|
|
|
public function setName($name) |
60
|
|
|
{ |
61
|
|
|
$this->name = $name; |
62
|
|
|
|
63
|
|
|
return $this; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* Get name |
68
|
|
|
* |
69
|
|
|
* @return string |
70
|
|
|
*/ |
71
|
|
|
public function getName() |
72
|
|
|
{ |
73
|
|
|
return $this->name; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* Set slug |
78
|
|
|
* |
79
|
|
|
* @param string $slug |
80
|
|
|
* |
81
|
|
|
* @return ProjectModel |
82
|
10 |
|
*/ |
83
|
|
|
public function setSlug($slug) |
84
|
|
|
{ |
85
|
10 |
|
$this->slug = $slug; |
86
|
|
|
|
87
|
|
|
return $this; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
3 |
|
* Get slug |
92
|
3 |
|
* |
93
|
|
|
* @return string |
94
|
3 |
|
*/ |
95
|
|
|
public function getSlug() |
96
|
|
|
{ |
97
|
|
|
return $this->slug; |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* @param string $description |
102
|
|
|
* @return ProjectModel |
103
|
|
|
*/ |
104
|
|
|
public function setDescription($description) { |
105
|
|
|
$this->description = $description; |
106
|
|
|
|
107
|
|
|
return $this; |
108
|
|
|
} |
109
|
3 |
|
|
110
|
|
|
/** |
111
|
3 |
|
* @return string |
112
|
|
|
*/ |
113
|
|
|
public function getDescription() { |
114
|
|
|
return $this->description; |
115
|
|
|
} |
116
|
|
|
|
117
|
|
|
/** |
118
|
|
|
* Set createdAt |
119
|
|
|
* |
120
|
|
|
* @param \DateTime $createdAt |
121
|
3 |
|
* |
122
|
|
|
* @return ProjectModel |
123
|
3 |
|
*/ |
124
|
|
|
public function setCreatedAt($createdAt) |
125
|
3 |
|
{ |
126
|
|
|
$this->createdAt = $createdAt; |
127
|
|
|
|
128
|
|
|
return $this; |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
/** |
132
|
|
|
* Get createdAt |
133
|
4 |
|
* |
134
|
|
|
* @return \DateTime |
135
|
4 |
|
*/ |
136
|
|
|
public function getCreatedAt() |
137
|
|
|
{ |
138
|
|
|
return $this->createdAt; |
139
|
|
|
} |
140
|
|
|
|
141
|
|
|
/** |
142
|
|
|
* Set updatedAt |
143
|
|
|
* |
144
|
|
|
* @param \DateTime $updatedAt |
145
|
3 |
|
* |
146
|
|
|
* @return ProjectModel |
147
|
3 |
|
*/ |
148
|
|
|
public function setUpdatedAt($updatedAt) |
149
|
3 |
|
{ |
150
|
|
|
$this->updatedAt = $updatedAt; |
|
|
|
|
151
|
|
|
|
152
|
|
|
return $this; |
153
|
|
|
} |
154
|
|
|
|
155
|
|
|
/** |
156
|
|
|
* Get updatedAt |
157
|
4 |
|
* |
158
|
|
|
* @return \DateTime |
159
|
4 |
|
*/ |
160
|
|
|
public function getUpdatedAt() |
161
|
|
|
{ |
162
|
|
|
return $this->updatedAt; |
163
|
|
|
} |
164
|
|
|
|
165
|
|
|
/** |
166
|
|
|
* Set nbBetaTesters |
167
|
|
|
* |
168
|
|
|
* @param integer $nbBetaTesters |
169
|
3 |
|
* |
170
|
|
|
* @return ProjectModel |
171
|
3 |
|
*/ |
172
|
|
|
public function setNbBetaTesters($nbBetaTesters) |
173
|
3 |
|
{ |
174
|
|
|
$this->nbBetaTesters = $nbBetaTesters; |
175
|
|
|
|
176
|
|
|
return $this; |
177
|
|
|
} |
178
|
|
|
|
179
|
|
|
/** |
180
|
|
|
* Get nbBetaTesters |
181
|
1 |
|
* |
182
|
|
|
* @return int |
183
|
1 |
|
*/ |
184
|
|
|
public function getNbBetaTesters() |
185
|
|
|
{ |
186
|
|
|
return $this->nbBetaTesters; |
187
|
|
|
} |
188
|
|
|
|
189
|
|
|
/** |
190
|
|
|
* Set betaTestStatus |
191
|
|
|
* |
192
|
|
|
* @param string $betaTestStatus |
193
|
3 |
|
* |
194
|
|
|
* @return ProjectModel |
195
|
3 |
|
*/ |
196
|
|
|
public function setBetaTestStatus($betaTestStatus) |
197
|
3 |
|
{ |
198
|
|
|
$this->betaTestStatus = $betaTestStatus; |
199
|
|
|
|
200
|
|
|
return $this; |
201
|
|
|
} |
202
|
|
|
|
203
|
|
|
/** |
204
|
|
|
* Get betaTestStatus |
205
|
2 |
|
* |
206
|
|
|
* @return string |
207
|
2 |
|
*/ |
208
|
|
|
public function getBetaTestStatus() |
209
|
|
|
{ |
210
|
|
|
return $this->betaTestStatus; |
211
|
|
|
} |
212
|
|
|
|
213
|
|
|
/** |
214
|
|
|
* Set productOwner |
215
|
|
|
* |
216
|
|
|
* @param object $productOwner |
217
|
3 |
|
* |
218
|
|
|
* @return ProjectModel |
219
|
3 |
|
*/ |
220
|
|
|
public function setProductOwner($productOwner) |
221
|
3 |
|
{ |
222
|
|
|
$this->productOwner = $productOwner; |
223
|
|
|
|
224
|
|
|
return $this; |
225
|
|
|
} |
226
|
|
|
|
227
|
|
|
/** |
228
|
|
|
* Get productOwner |
229
|
2 |
|
* |
230
|
|
|
* @return object |
231
|
2 |
|
*/ |
232
|
|
|
public function getProductOwner() |
233
|
|
|
{ |
234
|
|
|
return $this->productOwner; |
235
|
|
|
} |
236
|
|
|
|
237
|
|
|
/** |
238
|
|
|
* @param FeatureModel $feature |
239
|
|
|
* @return ProjectModel |
240
|
|
|
*/ |
241
|
4 |
|
public function addFeature(FeatureModel $feature) { |
242
|
|
|
$this->features->add($feature); |
243
|
4 |
|
|
244
|
|
|
return $this; |
245
|
4 |
|
} |
246
|
|
|
|
247
|
|
|
/** |
248
|
|
|
* @param FeatureModel $feature |
249
|
|
|
* @return ProjectModel |
250
|
|
|
*/ |
251
|
|
|
public function removeFeature(FeatureModel $feature) { |
252
|
|
|
$this->features->removeElement($feature); |
253
|
2 |
|
|
254
|
|
|
return $this; |
255
|
2 |
|
} |
256
|
|
|
|
257
|
|
|
/** |
258
|
|
|
* @param FeatureModel $feature |
259
|
|
|
* @return boolean |
260
|
|
|
*/ |
261
|
|
|
public function hasFeature(FeatureModel $feature) { |
262
|
1 |
|
return $this->features->contains($feature); |
263
|
|
|
} |
264
|
|
|
|
265
|
1 |
|
/** |
266
|
1 |
|
* @return ArrayCollection |
267
|
|
|
*/ |
268
|
|
|
public function getFeatures() { |
269
|
|
|
return $this->features; |
270
|
|
|
} |
271
|
|
|
|
272
|
1 |
|
/** |
273
|
|
|
* @param FeedbackModel $feedback |
274
|
|
|
* @return ProjectModel |
275
|
1 |
|
*/ |
276
|
1 |
|
public function addFeedback(FeedbackModel $feedback) { |
277
|
|
|
$this->feedbacks->add($feedback); |
278
|
|
|
|
279
|
|
|
return $this; |
280
|
|
|
} |
281
|
|
|
|
282
|
1 |
|
/** |
283
|
|
|
* @param FeedbackModel $feedback |
284
|
1 |
|
* @return ProjectModel |
285
|
|
|
*/ |
286
|
|
|
public function removeFeedback(FeedbackModel $feedback) { |
287
|
|
|
$this->feedbacks->removeElement($feedback); |
288
|
|
|
|
289
|
1 |
|
return $this; |
290
|
1 |
|
} |
291
|
|
|
|
292
|
|
|
/** |
293
|
|
|
* @param FeedbackModel $feedback |
294
|
|
|
* @return boolean |
295
|
|
|
*/ |
296
|
|
|
public function hasFeedback(FeedbackModel $feedback) { |
297
|
|
|
return $this->feedbacks->contains($feedback); |
298
|
|
|
} |
299
|
|
|
|
300
|
|
|
/** |
301
|
|
|
* @return ArrayCollection |
302
|
|
|
*/ |
303
|
|
|
public function getFeedbacks() { |
304
|
|
|
return $this->feedbacks; |
305
|
|
|
} |
306
|
|
|
} |
307
|
|
|
|
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: