Test Setup Failed
Push — master ( f71949...6c6bd7 )
by Julito
55:21
created

CarePost::setExternalSource()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\PluginBundle\Entity\StudentFollowUp;
5
6
use Gedmo\Mapping\Annotation as Gedmo;
7
use Doctrine\ORM\Mapping as ORM;
8
9
/**
10
 * CarePost
11
 *
12
 * @ORM\Table(name="sfu_post")
13
 * @ORM\Entity
14
 * @Gedmo\Tree(type="nested")
15
 */
16
class CarePost
17
{
18
    /**
19
     * @var integer
20
     *
21
     * @ORM\Column(name="id", type="integer")
22
     * @ORM\Id
23
     * @ORM\GeneratedValue
24
     */
25
    protected $id;
26
27
    /**
28
     * @var string
29
     *
30
     * @ORM\Column(name="title", type="string", length=255, nullable=false)
31
     */
32
    protected $title;
33
34
    /**
35
     * @var string
36
     *
37
     * @ORM\Column(name="content", type="text", nullable=true)
38
     */
39
    protected $content;
40
41
    /**
42
     * @var string
43
     *
44
     * @ORM\Column(name="external_care_id", type="string", nullable=true)
45
     */
46
    protected $externalCareId;
47
48
     /**
49
     * @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User", cascade={"persist"})
50
     * @ORM\JoinColumn(name="insert_user_id", referencedColumnName="id", nullable=false)
51
     */
52
    private $insertUser;
53
54
    /**
55
     * @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User", cascade={"persist"})
56
     * @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
57
     */
58
    private $user;
59
60
    /**
61
     * @ORM\Column(name="created_at", type="datetime", nullable=true)
62
     */
63
    protected $createdAt;
64
65
    /**
66
     * @ORM\Column(name="updated_at", type="datetime", nullable=true)
67
     */
68
    protected $updatedAt;
69
70
    /**
71
     * @var bool
72
     *
73
     * @ORM\Column(name="private", type="boolean")
74
     */
75
    protected $private;
76
77
    /**
78
     * @var bool
79
     *
80
     * @ORM\Column(name="external_source", type="boolean")
81
     */
82
    protected $externalSource;
83
84
    /**
85
     * @var array
86
     *
87
     * @ORM\Column(name="tags", type="array")
88
     */
89
    protected $tags;
90
91
    /**
92
     * @var string
93
     *
94
     * @ORM\Column(name="attachment", type="string", length=255)
95
     */
96
    protected $attachment;
97
98
    /**
99
     * @Gedmo\TreeParent
100
     * @ORM\ManyToOne(targetEntity="CarePost", inversedBy="children")
101
     * @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="SET NULL")
102
     */
103
    private $parent;
104
105
     /**
106
     * @ORM\OneToMany(targetEntity="CarePost", mappedBy="parent")
107
     * @ORM\OrderBy({"createdAt" = "DESC"})
108
     */
109
    private $children;
110
111
    /**
112
     * @var integer
113
     * @Gedmo\TreeLeft
114
     * @ORM\Column(name="lft", type="integer", nullable=true, unique=false)
115
     */
116
    private $lft;
0 ignored issues
show
Unused Code introduced by
The property $lft is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
117
118
    /**
119
     * @var integer
120
     * @Gedmo\TreeRight
121
     * @ORM\Column(name="rgt", type="integer", nullable=true, unique=false)
122
     */
123
    private $rgt;
0 ignored issues
show
Unused Code introduced by
The property $rgt is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
124
125
    /**
126
     * @var integer
127
     * @Gedmo\TreeLevel
128
     * @ORM\Column(name="lvl", type="integer", nullable=true, unique=false)
129
     */
130
    private $lvl;
0 ignored issues
show
Unused Code introduced by
The property $lvl is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
131
132
    /**
133
     * @var integer
134
     * @Gedmo\TreeRoot
135
     * @ORM\Column(name="root", type="integer", nullable=true, unique=false)
136
     */
137
    private $root;
0 ignored issues
show
Unused Code introduced by
The property $root is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
138
139
    /**
140
     * Project constructor.
141
     */
142
    public function __construct()
143
    {
144
        $this->createdAt = new \DateTime();
145
        $this->attachment = '';
146
    }
147
148
    /**
149
     * @return int
150
     */
151
    public function getId()
152
    {
153
        return $this->id;
154
    }
155
156
    /**
157
     * @param int $id
158
     * @return $this
159
     */
160
    public function setId($id)
161
    {
162
        $this->id = $id;
163
164
        return $this;
165
    }
166
167
    /**
168
     * @return string
169
     */
170
    public function getTitle()
171
    {
172
        return $this->title;
173
    }
174
175
    /**
176
     * @param string $title
177
     * @return CarePost
178
     */
179
    public function setTitle($title)
180
    {
181
        $this->title = $title;
182
183
        return $this;
184
    }
185
186
    /**
187
     * @return string
188
     */
189
    public function getContent()
190
    {
191
        return $this->content;
192
    }
193
194
    /**
195
     * @param string $content
196
     * @return CarePost
197
     */
198
    public function setContent($content)
199
    {
200
        $this->content = $content;
201
202
        return $this;
203
    }
204
205
    /**
206
     * @return string
207
     */
208
    public function getExternalCareId()
209
    {
210
        return $this->externalCareId;
211
    }
212
213
    /**
214
     * @param string $externalCareId
215
     * @return CarePost
216
     */
217
    public function setExternalCareId($externalCareId)
218
    {
219
        $this->externalCareId = $externalCareId;
220
221
        return $this;
222
    }
223
224
    /**
225
     * @return mixed
226
     */
227
    public function getUser()
228
    {
229
        return $this->user;
230
    }
231
232
    /**
233
     * @param mixed $user
234
     * @return CarePost
235
     */
236
    public function setUser($user)
237
    {
238
        $this->user = $user;
239
240
        return $this;
241
    }
242
243
    /**
244
     * @return bool
245
     */
246
    public function isPrivate()
247
    {
248
        return $this->private;
249
    }
250
251
    /**
252
     * @param bool $private
253
     * @return CarePost
254
     */
255
    public function setPrivate($private)
256
    {
257
        $this->private = $private;
258
259
        return $this;
260
    }
261
262
    /**
263
     * @return bool
264
     */
265
    public function isExternalSource()
266
    {
267
        return $this->externalSource;
268
    }
269
270
    /**
271
     * @param bool $externalSource
272
     * @return CarePost
273
     */
274
    public function setExternalSource($externalSource)
275
    {
276
        $this->externalSource = $externalSource;
277
278
        return $this;
279
    }
280
281
    /**
282
     * @return string
283
     */
284
    public function getAttachment()
285
    {
286
        return $this->attachment;
287
    }
288
289
    /**
290
     * @param string $attachment
291
     * @return CarePost
292
     */
293
    public function setAttachment($attachment)
294
    {
295
        $this->attachment = $attachment;
296
297
        return $this;
298
    }
299
300
    /**
301
     * @return mixed
302
     */
303
    public function getParent()
304
    {
305
        return $this->parent;
306
    }
307
308
    /**
309
     * @param mixed $parent
310
     * @return CarePost
311
     */
312
    public function setParent($parent)
313
    {
314
        $this->parent = $parent;
315
316
        return $this;
317
    }
318
319
    /**
320
     * @return int
321
     */
322
    public function hasParent()
323
    {
324
        return !empty($this->parent) ? 1 : 0;
325
    }
326
327
    /**
328
     * @return mixed
329
     */
330
    public function getChildren()
331
    {
332
        return $this->children;
333
    }
334
335
    /**
336
     * @param mixed $children
337
     * @return CarePost
338
     */
339
    public function setChildren($children)
340
    {
341
        $this->children = $children;
342
343
        return $this;
344
    }
345
346
    /**
347
     * @return mixed
348
     */
349
    public function getCreatedAt()
350
    {
351
        return $this->createdAt;
352
    }
353
354
    /**
355
     * @param mixed $createdAt
356
     * @return CarePost
357
     */
358
    public function setCreatedAt($createdAt)
359
    {
360
        $this->createdAt = $createdAt;
361
362
        return $this;
363
    }
364
365
    /**
366
     * @return mixed
367
     */
368
    public function getUpdatedAt()
369
    {
370
        return $this->updatedAt;
371
    }
372
373
    /**
374
     * @param mixed $updatedAt
375
     * @return CarePost
376
     */
377
    public function setUpdatedAt($updatedAt)
378
    {
379
        $this->updatedAt = $updatedAt;
380
381
        return $this;
382
    }
383
384
    /**
385
     * @return array
386
     */
387
    public function getTags()
388
    {
389
        return $this->tags;
390
    }
391
392
    /**
393
     * @param array $tags
394
     * @return CarePost
395
     */
396
    public function setTags($tags)
397
    {
398
        $this->tags = $tags;
399
400
        return $this;
401
    }
402
403
    /**
404
     * @return mixed
405
     */
406
    public function getInsertUser()
407
    {
408
        return $this->insertUser;
409
    }
410
411
    /**
412
     * @param mixed $insertUser
413
     * @return CarePost
414
     */
415
    public function setInsertUser($insertUser)
416
    {
417
        $this->insertUser = $insertUser;
418
419
        return $this;
420
    }
421
422
}
423