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