Completed
Push — master ( b322d1...651cee )
by Axel
8s
created

FeedbackModel::setCreatedAt()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Developtech\AgilityBundle\Model;
4
5
use Doctrine\ORM\Mapping as ORM;
6
7
use Symfony\Component\Security\Core\User\UserInterface;
8
9
/**
10
 * FeedbackModel
11
 *
12
 * @ORM\Entity(repositoryClass="Developtech\AgilityBundle\Repository\FeedbackModelRepository")
13
 * @ORM\HasLifecycleCallbacks()
14
 */
15
class FeedbackModel
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)
30
     */
31
    protected $name;
32
33
    /**
34
     * @var string
35
     *
36
     * @ORM\Column(name="slug", type="string", length=125)
37
     */
38
    protected $slug;
39
40
    /**
41
     * @var string
42
     *
43
     * @ORM\Column(name="description", type="string", length=255)
44
     */
45
    protected $description;
46
47
    /**
48
     * @var ProjectModel
49
     *
50
     * This field must be mapped by the end-user to the Project extended class
51
     */
52
    protected $project;
53
54
    /**
55
     * @var UserInterface
56
     *
57
     * This field must be mapped by the end-user
58
     */
59
    protected $author;
60
61
    /**
62
     * @var int
63
     *
64
     * @ORM\Column(name="status", type="integer")
65
     */
66
    protected $status;
67
68
    /**
69
     * @var UserInterface
70
     *
71
     * This field must be mapped by the end-user
72
     */
73
    protected $developer;
74
75
    /**
76
     * @var \DateTime
77
     *
78
     * @ORM\Column(name="createdAt", type="datetime")
79
     */
80
    protected $createdAt;
81
82
    /**
83
     * @var \DateTime
84
     *
85
     * @ORM\Column(name="updatedAt", type="datetime")
86
     */
87
    protected $updatedAt;
88
89
    const STATUS_OPEN = 0;
90
    const STATUS_TO_DO = 1;
91
    const STATUS_IN_PROGRESS = 2;
92
    const STATUS_TO_VALIDATE = 3;
93
    const STATUS_DONE = 4;
94
    const STATUS_CLOSED = 5;
95
96
    /**
97
     * @ORM\PrePersist()
98
     */
99
    public function prePersist() {
100
        $this->createdAt = $this->updatedAt = new \DateTime();
101
    }
102
103
    /**
104
     * @ORM\PreUpdate()
105
     */
106
    public function preUpdate() {
107
        $this->updatedAt = new \DateTime();
108
    }
109
110
    /**
111
     * @param integer $id
112
     * @return FeedbackModel
113
     */
114 2
    public function setId($id) {
115 2
        $this->id = $id;
116
117 2
        return $this;
118
    }
119
120
    /**
121
     * Get id
122
     *
123
     * @return int
124
     */
125 3
    public function getId()
126
    {
127 3
        return $this->id;
128
    }
129
130
    /**
131
     * Set name
132
     *
133
     * @param string $name
134
     *
135
     * @return FeedbackModel
136
     */
137 3
    public function setName($name)
138
    {
139 3
        $this->name = $name;
140
141 3
        return $this;
142
    }
143
144
    /**
145
     * Get name
146
     *
147
     * @return string
148
     */
149 1
    public function getName()
150
    {
151 1
        return $this->name;
152
    }
153
154
    /**
155
     * Set slug
156
     *
157
     * @param string $slug
158
     *
159
     * @return FeedbackModel
160
     */
161 3
    public function setSlug($slug)
162
    {
163 3
        $this->slug = $slug;
164
165 3
        return $this;
166
    }
167
168
    /**
169
     * Get slug
170
     *
171
     * @return string
172
     */
173 1
    public function getSlug()
174
    {
175 1
        return $this->slug;
176
    }
177
178
    /**
179
     * Set description
180
     *
181
     * @param string $description
182
     *
183
     * @return FeedbackModel
184
     */
185 3
    public function setDescription($description)
186
    {
187 3
        $this->description = $description;
188
189 3
        return $this;
190
    }
191
192
    /**
193
     * Get description
194
     *
195
     * @return string
196
     */
197 1
    public function getDescription()
198
    {
199 1
        return $this->description;
200
    }
201
202
    /**
203
     * Set project
204
     *
205
     * @param ProjectModel $project
206
     *
207
     * @return FeedbackModel
208
     */
209 3
    public function setProject(ProjectModel $project)
210
    {
211 3
        $this->project = $project;
212
213 3
        return $this;
214 3
    }
215
216
    /**
217
     * Get project
218
     *
219
     * @return ProjectModel
220
     */
221 1
    public function getProject()
222
    {
223 1
        return $this->project;
224
    }
225
226
    /**
227
     * Set author
228
     *
229
     * @param UserInterface $author
230
     *
231
     * @return FeedbackModel
232
     */
233 3
    public function setAuthor(UserInterface $author)
234
    {
235 3
        $this->author = $author;
236
237 3
        return $this;
238 3
    }
239
240
    /**
241
     * Get author
242
     *
243
     * @return UserInterface
244
     */
245 1
    public function getAuthor()
246
    {
247 1
        return $this->author;
248
    }
249
250
    /**
251
     * Set status
252
     *
253
     * @param integer $status
254
     *
255
     * @return FeedbackModel
256
     */
257 2
    public function setStatus($status)
258
    {
259 2
        $this->status = $status;
260
261 2
        return $this;
262
    }
263
264
    /**
265
     * Get status
266
     *
267
     * @return int
268
     */
269 1
    public function getStatus()
270
    {
271 1
        return $this->status;
272
    }
273
274
    /**
275
     * Set developer
276
     *
277
     * @param UserInterface $developer
278
     *
279
     * @return FeedbackModel
280
     */
281 2
    public function setDeveloper(UserInterface $developer)
282
    {
283 2
        $this->developer = $developer;
284
285 2
        return $this;
286 2
    }
287
288
    /**
289
     * Get developer
290
     *
291
     * @return UserInterface
292
     */
293
    public function getDeveloper()
294
    {
295
        return $this->developer;
296
    }
297
298
    /**
299
     * Set createdAt
300
     *
301
     * @param \DateTime $createdAt
302
     *
303
     * @return FeedbackModel
304
     */
305 2
    public function setCreatedAt($createdAt)
306
    {
307 2
        $this->createdAt = $createdAt;
308
309 2
        return $this;
310
    }
311
312
    /**
313
     * Get createdAt
314
     *
315
     * @return \DateTime
316
     */
317
    public function getCreatedAt()
318
    {
319
        return $this->createdAt;
320
    }
321
322
    /**
323
     * Set updatedAt
324
     *
325
     * @param \DateTime $updatedAt
326
     *
327
     * @return FeedbackModel
328
     */
329 2
    public function setUpdatedAt($updatedAt)
330
    {
331 2
        $this->updatedAt = $updatedAt;
332
333 2
        return $this;
334
    }
335
336
    /**
337
     * Get updatedAt
338
     *
339
     * @return \DateTime
340
     */
341
    public function getUpdatedAt()
342
    {
343
        return $this->updatedAt;
344
    }
345
}
346