1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Developtech\AgilityBundle\Model; |
4
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
6
|
|
|
|
7
|
|
|
use Doctrine\Common\Collections\ArrayCollection; |
8
|
|
|
use Symfony\Component\Security\Core\User\UserInterface; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* Project |
12
|
|
|
*/ |
13
|
|
|
abstract class ProjectModel |
14
|
|
|
{ |
15
|
|
|
/** @var string */ |
16
|
|
|
protected $name; |
17
|
|
|
/** @var string */ |
18
|
|
|
protected $slug; |
19
|
|
|
/** @var string **/ |
20
|
|
|
protected $description; |
21
|
|
|
/** @var \DateTime */ |
22
|
|
|
protected $createdAt; |
23
|
|
|
/** @var ArrayCollection */ |
24
|
|
|
protected $betaTests; |
25
|
|
|
/** @var UserInterface */ |
26
|
|
|
protected $productOwner; |
27
|
|
|
/** @var ArrayCollection */ |
28
|
|
|
protected $features; |
29
|
|
|
/** @var ArrayCollection */ |
30
|
|
|
protected $feedbacks; |
31
|
|
|
|
32
|
13 |
|
public function __construct() { |
33
|
|
|
$this->betaTests = new ArrayCollection(); |
34
|
|
|
$this->features = new ArrayCollection(); |
35
|
|
|
$this->feedbacks = new ArrayCollection(); |
36
|
13 |
|
} |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* Set name |
40
|
|
|
* |
41
|
|
|
* @param string $name |
42
|
|
|
* |
43
|
|
|
* @return ProjectModel |
44
|
|
|
*/ |
45
|
3 |
|
public function setName($name) |
46
|
|
|
{ |
47
|
3 |
|
$this->name = $name; |
48
|
|
|
|
49
|
3 |
|
return $this; |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* Get name |
54
|
|
|
* |
55
|
|
|
* @return string |
56
|
|
|
*/ |
57
|
4 |
|
public function getName() |
58
|
|
|
{ |
59
|
4 |
|
return $this->name; |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* Set slug |
64
|
|
|
* |
65
|
|
|
* @param string $slug |
66
|
|
|
* |
67
|
|
|
* @return ProjectModel |
68
|
|
|
*/ |
69
|
3 |
|
public function setSlug($slug) |
70
|
|
|
{ |
71
|
3 |
|
$this->slug = $slug; |
72
|
|
|
|
73
|
3 |
|
return $this; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* Get slug |
78
|
|
|
* |
79
|
|
|
* @return string |
80
|
|
|
*/ |
81
|
4 |
|
public function getSlug() |
82
|
|
|
{ |
83
|
4 |
|
return $this->slug; |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @param string $description |
88
|
|
|
* @return ProjectModel |
89
|
|
|
*/ |
90
|
|
|
public function setDescription($description) { |
91
|
|
|
$this->description = $description; |
92
|
|
|
|
93
|
|
|
return $this; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* @return string |
98
|
|
|
*/ |
99
|
|
|
public function getDescription() { |
100
|
|
|
return $this->description; |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* Set createdAt |
105
|
|
|
* |
106
|
|
|
* @param \DateTime $createdAt |
107
|
|
|
* |
108
|
|
|
* @return ProjectModel |
109
|
|
|
*/ |
110
|
3 |
|
public function setCreatedAt($createdAt) |
111
|
|
|
{ |
112
|
3 |
|
$this->createdAt = $createdAt; |
113
|
|
|
|
114
|
3 |
|
return $this; |
115
|
|
|
} |
116
|
|
|
|
117
|
|
|
/** |
118
|
|
|
* Get createdAt |
119
|
|
|
* |
120
|
|
|
* @return \DateTime |
121
|
|
|
*/ |
122
|
1 |
|
public function getCreatedAt() |
123
|
|
|
{ |
124
|
1 |
|
return $this->createdAt; |
125
|
|
|
} |
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* Set updatedAt |
129
|
|
|
* |
130
|
|
|
* @param \DateTime $updatedAt |
131
|
|
|
* |
132
|
|
|
* @return ProjectModel |
133
|
|
|
*/ |
134
|
|
|
public function setUpdatedAt($updatedAt) |
135
|
|
|
{ |
136
|
|
|
$this->updatedAt = $updatedAt; |
|
|
|
|
137
|
|
|
|
138
|
|
|
return $this; |
139
|
|
|
} |
140
|
|
|
|
141
|
|
|
/** |
142
|
|
|
* Get updatedAt |
143
|
|
|
* |
144
|
|
|
* @return \DateTime |
145
|
|
|
*/ |
146
|
|
|
public function getUpdatedAt() |
147
|
|
|
{ |
148
|
|
|
return $this->updatedAt; |
149
|
|
|
} |
150
|
|
|
|
151
|
|
|
/** |
152
|
|
|
* @param BetaTestModel $betaTest |
153
|
|
|
* @return ProjectModel |
154
|
|
|
*/ |
155
|
|
|
public function addBetaTest(BetaTestModel $betaTest) { |
156
|
|
|
$this->betaTests->add($betaTest); |
157
|
|
|
|
158
|
|
|
return $this; |
159
|
|
|
} |
160
|
|
|
|
161
|
|
|
/** |
162
|
|
|
* @param BetaTestModel $betaTest |
163
|
|
|
* @return ProjectModel |
164
|
|
|
*/ |
165
|
1 |
|
public function removeBetaTest(BetaTestModel $betaTest) { |
166
|
|
|
$this->betaTests->removeElement($betaTest); |
167
|
|
|
|
168
|
1 |
|
return $this; |
169
|
1 |
|
} |
170
|
|
|
|
171
|
|
|
/** |
172
|
|
|
* @param BetaTestModel $betaTest |
173
|
|
|
* @return boolean |
174
|
|
|
*/ |
175
|
|
|
public function hasBetaTest(BetaTestModel $betaTest) { |
176
|
|
|
return $this->betaTests->contains($betaTest); |
177
|
|
|
} |
178
|
|
|
|
179
|
|
|
/** |
180
|
|
|
* @return ArrayCollection |
181
|
|
|
*/ |
182
|
1 |
|
public function getBetaTests() { |
183
|
1 |
|
return $this->betaTests; |
184
|
|
|
} |
185
|
|
|
|
186
|
|
|
/** |
187
|
|
|
* Set productOwner |
188
|
|
|
* |
189
|
|
|
* @param UserInterface $productOwner |
190
|
|
|
* |
191
|
|
|
* @return ProjectModel |
192
|
|
|
*/ |
193
|
4 |
|
public function setProductOwner(UserInterface $productOwner) |
194
|
|
|
{ |
195
|
4 |
|
$this->productOwner = $productOwner; |
196
|
|
|
|
197
|
4 |
|
return $this; |
198
|
4 |
|
} |
199
|
|
|
|
200
|
|
|
/** |
201
|
|
|
* Get productOwner |
202
|
|
|
* |
203
|
|
|
* @return UserInterface |
204
|
|
|
*/ |
205
|
2 |
|
public function getProductOwner() |
206
|
|
|
{ |
207
|
2 |
|
return $this->productOwner; |
208
|
|
|
} |
209
|
|
|
|
210
|
|
|
/** |
211
|
|
|
* @param JobModel $feature |
212
|
|
|
* @return ProjectModel |
213
|
|
|
*/ |
214
|
1 |
|
public function addFeature(JobModel $feature) { |
215
|
|
|
$this->features->add($feature); |
216
|
|
|
|
217
|
1 |
|
return $this; |
218
|
1 |
|
} |
219
|
|
|
|
220
|
|
|
/** |
221
|
|
|
* @param JobModel $feature |
222
|
|
|
* @return ProjectModel |
223
|
|
|
*/ |
224
|
1 |
|
public function removeFeature(JobModel $feature) { |
225
|
|
|
$this->features->removeElement($feature); |
226
|
|
|
|
227
|
1 |
|
return $this; |
228
|
1 |
|
} |
229
|
|
|
|
230
|
|
|
/** |
231
|
|
|
* @param JobModel $feature |
232
|
|
|
* @return boolean |
233
|
|
|
*/ |
234
|
1 |
|
public function hasFeature(JobModel $feature) { |
235
|
|
|
return $this->features->contains($feature); |
236
|
1 |
|
} |
237
|
|
|
|
238
|
|
|
/** |
239
|
|
|
* @return ArrayCollection |
240
|
|
|
*/ |
241
|
1 |
|
public function getFeatures() { |
242
|
1 |
|
return $this->features; |
243
|
|
|
} |
244
|
|
|
|
245
|
|
|
/** |
246
|
|
|
* @param JobModel $feedback |
247
|
|
|
* @return ProjectModel |
248
|
|
|
*/ |
249
|
|
|
public function addFeedback(JobModel $feedback) { |
250
|
|
|
$this->feedbacks->add($feedback); |
251
|
|
|
|
252
|
|
|
return $this; |
253
|
|
|
} |
254
|
|
|
|
255
|
|
|
/** |
256
|
|
|
* @param JobModel $feedback |
257
|
|
|
* @return ProjectModel |
258
|
|
|
*/ |
259
|
1 |
|
public function removeFeedback(JobModel $feedback) { |
260
|
|
|
$this->feedbacks->removeElement($feedback); |
261
|
|
|
|
262
|
1 |
|
return $this; |
263
|
1 |
|
} |
264
|
|
|
|
265
|
|
|
/** |
266
|
|
|
* @param JobModel $feedback |
267
|
|
|
* @return boolean |
268
|
|
|
*/ |
269
|
1 |
|
public function hasFeedback(JobModel $feedback) { |
270
|
|
|
return $this->feedbacks->contains($feedback); |
271
|
1 |
|
} |
272
|
|
|
|
273
|
|
|
/** |
274
|
|
|
* @return ArrayCollection |
275
|
|
|
*/ |
276
|
1 |
|
public function getFeedbacks() { |
277
|
1 |
|
return $this->feedbacks; |
278
|
|
|
} |
279
|
|
|
} |
280
|
|
|
|
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: