1 | <?php |
||
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 int */ |
||
24 | protected $nbBetaTesters; |
||
25 | /** @var string */ |
||
26 | protected $betaTestStatus; |
||
27 | /** @var UserInterface */ |
||
28 | protected $productOwner; |
||
29 | /** @var ArrayCollection */ |
||
30 | protected $features; |
||
31 | /** @var ArrayCollection */ |
||
32 | protected $feedbacks; |
||
33 | |||
34 | 16 | public function __construct() { |
|
35 | 16 | $this->features = new ArrayCollection(); |
|
36 | 16 | $this->feedbacks = new ArrayCollection(); |
|
37 | 16 | } |
|
38 | |||
39 | /** |
||
40 | * Set name |
||
41 | * |
||
42 | * @param string $name |
||
43 | * |
||
44 | * @return ProjectModel |
||
45 | */ |
||
46 | 6 | public function setName($name) |
|
52 | |||
53 | /** |
||
54 | * Get name |
||
55 | * |
||
56 | * @return string |
||
57 | */ |
||
58 | 4 | public function getName() |
|
62 | |||
63 | /** |
||
64 | * Set slug |
||
65 | * |
||
66 | * @param string $slug |
||
67 | * |
||
68 | * @return ProjectModel |
||
69 | */ |
||
70 | 6 | public function setSlug($slug) |
|
76 | |||
77 | /** |
||
78 | * Get slug |
||
79 | * |
||
80 | * @return string |
||
81 | */ |
||
82 | 4 | public function getSlug() |
|
86 | |||
87 | /** |
||
88 | * @param string $description |
||
89 | * @return ProjectModel |
||
90 | */ |
||
91 | 1 | public function setDescription($description) { |
|
92 | 1 | $this->description = $description; |
|
93 | |||
94 | 1 | return $this; |
|
95 | } |
||
96 | |||
97 | /** |
||
98 | * @return string |
||
99 | */ |
||
100 | public function getDescription() { |
||
101 | return $this->description; |
||
102 | } |
||
103 | |||
104 | /** |
||
105 | * Set createdAt |
||
106 | * |
||
107 | * @param \DateTime $createdAt |
||
108 | * |
||
109 | * @return ProjectModel |
||
110 | */ |
||
111 | 5 | public function setCreatedAt($createdAt) |
|
117 | |||
118 | /** |
||
119 | * Get createdAt |
||
120 | * |
||
121 | * @return \DateTime |
||
122 | */ |
||
123 | 1 | public function getCreatedAt() |
|
127 | |||
128 | /** |
||
129 | * Set updatedAt |
||
130 | * |
||
131 | * @param \DateTime $updatedAt |
||
132 | * |
||
133 | * @return ProjectModel |
||
134 | */ |
||
135 | public function setUpdatedAt($updatedAt) |
||
136 | { |
||
137 | $this->updatedAt = $updatedAt; |
||
|
|||
138 | |||
139 | return $this; |
||
140 | } |
||
141 | |||
142 | /** |
||
143 | * Get updatedAt |
||
144 | * |
||
145 | * @return \DateTime |
||
146 | */ |
||
147 | public function getUpdatedAt() |
||
148 | { |
||
149 | return $this->updatedAt; |
||
150 | } |
||
151 | |||
152 | /** |
||
153 | * Set nbBetaTesters |
||
154 | * |
||
155 | * @param integer $nbBetaTesters |
||
156 | * |
||
157 | * @return ProjectModel |
||
158 | */ |
||
159 | 6 | public function setNbBetaTesters($nbBetaTesters) |
|
165 | |||
166 | /** |
||
167 | * Get nbBetaTesters |
||
168 | * |
||
169 | * @return int |
||
170 | */ |
||
171 | 2 | public function getNbBetaTesters() |
|
175 | |||
176 | /** |
||
177 | * Set betaTestStatus |
||
178 | * |
||
179 | * @param string $betaTestStatus |
||
180 | * |
||
181 | * @return ProjectModel |
||
182 | */ |
||
183 | 6 | public function setBetaTestStatus($betaTestStatus) |
|
189 | |||
190 | /** |
||
191 | * Get betaTestStatus |
||
192 | * |
||
193 | * @return string |
||
194 | */ |
||
195 | 2 | public function getBetaTestStatus() |
|
199 | |||
200 | /** |
||
201 | * Set productOwner |
||
202 | * |
||
203 | * @param UserInterface $productOwner |
||
204 | * |
||
205 | * @return ProjectModel |
||
206 | */ |
||
207 | 4 | public function setProductOwner(UserInterface $productOwner) |
|
208 | { |
||
209 | 4 | $this->productOwner = $productOwner; |
|
210 | |||
211 | 4 | return $this; |
|
212 | } |
||
213 | |||
214 | /** |
||
215 | * Get productOwner |
||
216 | * |
||
217 | * @return UserInterface |
||
218 | */ |
||
219 | 2 | public function getProductOwner() |
|
223 | |||
224 | /** |
||
225 | * @param JobModel $feature |
||
226 | * @return ProjectModel |
||
227 | */ |
||
228 | 2 | public function addFeature(JobModel $feature) { |
|
233 | |||
234 | /** |
||
235 | * @param JobModel $feature |
||
236 | * @return ProjectModel |
||
237 | */ |
||
238 | 1 | public function removeFeature(JobModel $feature) { |
|
243 | |||
244 | /** |
||
245 | * @param JobModel $feature |
||
246 | * @return boolean |
||
247 | */ |
||
248 | 1 | public function hasFeature(JobModel $feature) { |
|
251 | |||
252 | /** |
||
253 | * @return ArrayCollection |
||
254 | */ |
||
255 | 1 | public function getFeatures() { |
|
258 | |||
259 | /** |
||
260 | * @param JobModel $feedback |
||
261 | * @return ProjectModel |
||
262 | */ |
||
263 | 1 | public function addFeedback(JobModel $feedback) { |
|
264 | 1 | $this->feedbacks->add($feedback); |
|
265 | |||
266 | 1 | return $this; |
|
267 | } |
||
268 | |||
269 | /** |
||
270 | * @param JobModel $feedback |
||
271 | * @return ProjectModel |
||
272 | */ |
||
273 | 1 | public function removeFeedback(JobModel $feedback) { |
|
278 | |||
279 | /** |
||
280 | * @param JobModel $feedback |
||
281 | * @return boolean |
||
282 | */ |
||
283 | 1 | public function hasFeedback(JobModel $feedback) { |
|
286 | |||
287 | /** |
||
288 | * @return ArrayCollection |
||
289 | */ |
||
290 | 1 | public function getFeedbacks() { |
|
293 | } |
||
294 |
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: