Passed
Push — master ( bcba07...4f2fea )
by Julito
08:02
created

CCalendarEvent   A

Complexity

Total Complexity 30

Size/Duplication

Total Lines 412
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 56
dl 0
loc 412
rs 10
c 0
b 0
f 0
wmc 30

30 Methods

Rating   Name   Duplication   Size   Complexity  
A setColor() 0 5 1
A setComment() 0 5 1
A getSessionId() 0 3 1
A setCId() 0 5 1
A getTitle() 0 3 1
A setAllDay() 0 5 1
A __toString() 0 3 1
A setIid() 0 5 1
A getEndDate() 0 3 1
A getStartDate() 0 3 1
A getId() 0 3 1
A setParentEventId() 0 5 1
A setContent() 0 5 1
A getContent() 0 3 1
A getAllDay() 0 3 1
A setRoom() 0 5 1
A setId() 0 5 1
A getResourceName() 0 3 1
A setTitle() 0 5 1
A getRoom() 0 3 1
A setStartDate() 0 5 1
A getColor() 0 3 1
A getResourceIdentifier() 0 3 1
A getComment() 0 3 1
A setSessionId() 0 5 1
A __construct() 0 2 1
A getIid() 0 3 1
A getCId() 0 3 1
A setEndDate() 0 5 1
A getParentEventId() 0 3 1
1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
namespace Chamilo\CourseBundle\Entity;
6
7
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
8
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
9
use Chamilo\CoreBundle\Entity\Room;
10
use Doctrine\ORM\Mapping as ORM;
11
12
/**
13
 * CCalendarEvent.
14
 *
15
 * @ORM\Table(
16
 *  name="c_calendar_event",
17
 *  indexes={
18
 *      @ORM\Index(name="course", columns={"c_id"}),
19
 *      @ORM\Index(name="session_id", columns={"session_id"})
20
 *  }
21
 * )
22
 * @ORM\Entity
23
 */
24
class CCalendarEvent extends AbstractResource implements ResourceInterface
25
{
26
    /**
27
     * @var int
28
     *
29
     * @ORM\Column(name="iid", type="integer")
30
     * @ORM\Id
31
     * @ORM\GeneratedValue
32
     */
33
    protected $iid;
34
35
    /**
36
     * @var int
37
     *
38
     * @ORM\Column(name="id", type="integer", nullable=true)
39
     */
40
    protected $id;
41
42
    /**
43
     * @var int
44
     *
45
     * @ORM\Column(name="c_id", type="integer")
46
     */
47
    protected $cId;
48
49
    /**
50
     * @var string
51
     *
52
     * @ORM\Column(name="title", type="string", length=255, nullable=false)
53
     */
54
    protected $title;
55
56
    /**
57
     * @var string
58
     *
59
     * @ORM\Column(name="content", type="text", nullable=true)
60
     */
61
    protected $content;
62
63
    /**
64
     * @var \DateTime
65
     *
66
     * @ORM\Column(name="start_date", type="datetime", nullable=true)
67
     */
68
    protected $startDate;
69
70
    /**
71
     * @var \DateTime
72
     *
73
     * @ORM\Column(name="end_date", type="datetime", nullable=true)
74
     */
75
    protected $endDate;
76
77
    /**
78
     * @var int
79
     *
80
     * @ORM\Column(name="parent_event_id", type="integer", nullable=true)
81
     */
82
    protected $parentEventId;
83
84
    /**
85
     * @var int
86
     *
87
     * @ORM\Column(name="session_id", type="integer", nullable=false)
88
     */
89
    protected $sessionId;
90
91
    /**
92
     * @var int
93
     *
94
     * @ORM\Column(name="all_day", type="integer", nullable=false)
95
     */
96
    protected $allDay;
97
98
    /**
99
     * @var string
100
     *
101
     * @ORM\Column(name="comment", type="text", nullable=true)
102
     */
103
    protected $comment;
104
105
    /**
106
     * @var string
107
     *
108
     * @ORM\Column(name="color", type="string", length=100, nullable=true)
109
     */
110
    protected $color;
111
112
    /**
113
     * @var Room
114
     *
115
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Room")
116
     * @ORM\JoinColumn(name="room_id", referencedColumnName="id")
117
     */
118
    protected $room;
119
120
    public function __construct()
121
    {
122
    }
123
124
    public function __toString(): string
125
    {
126
        return $this->getTitle();
127
    }
128
129
    /**
130
     * Set title.
131
     *
132
     * @param string $title
133
     *
134
     * @return CCalendarEvent
135
     */
136
    public function setTitle($title)
137
    {
138
        $this->title = $title;
139
140
        return $this;
141
    }
142
143
    /**
144
     * Get title.
145
     *
146
     * @return string
147
     */
148
    public function getTitle()
149
    {
150
        return $this->title;
151
    }
152
153
    /**
154
     * Set content.
155
     *
156
     * @param string $content
157
     *
158
     * @return CCalendarEvent
159
     */
160
    public function setContent($content)
161
    {
162
        $this->content = $content;
163
164
        return $this;
165
    }
166
167
    /**
168
     * Get content.
169
     *
170
     * @return string
171
     */
172
    public function getContent()
173
    {
174
        return $this->content;
175
    }
176
177
    /**
178
     * Set startDate.
179
     *
180
     * @param \DateTime $startDate
181
     *
182
     * @return CCalendarEvent
183
     */
184
    public function setStartDate($startDate)
185
    {
186
        $this->startDate = $startDate;
187
188
        return $this;
189
    }
190
191
    /**
192
     * Get startDate.
193
     *
194
     * @return \DateTime
195
     */
196
    public function getStartDate()
197
    {
198
        return $this->startDate;
199
    }
200
201
    /**
202
     * Set endDate.
203
     *
204
     * @param \DateTime $endDate
205
     *
206
     * @return CCalendarEvent
207
     */
208
    public function setEndDate($endDate)
209
    {
210
        $this->endDate = $endDate;
211
212
        return $this;
213
    }
214
215
    /**
216
     * Get endDate.
217
     *
218
     * @return \DateTime
219
     */
220
    public function getEndDate()
221
    {
222
        return $this->endDate;
223
    }
224
225
    /**
226
     * Set parentEventId.
227
     *
228
     * @param int $parentEventId
229
     *
230
     * @return CCalendarEvent
231
     */
232
    public function setParentEventId($parentEventId)
233
    {
234
        $this->parentEventId = $parentEventId;
235
236
        return $this;
237
    }
238
239
    /**
240
     * Get parentEventId.
241
     *
242
     * @return int
243
     */
244
    public function getParentEventId()
245
    {
246
        return $this->parentEventId;
247
    }
248
249
    /**
250
     * Set sessionId.
251
     *
252
     * @param int $sessionId
253
     *
254
     * @return CCalendarEvent
255
     */
256
    public function setSessionId($sessionId)
257
    {
258
        $this->sessionId = $sessionId;
259
260
        return $this;
261
    }
262
263
    /**
264
     * Get sessionId.
265
     *
266
     * @return int
267
     */
268
    public function getSessionId()
269
    {
270
        return $this->sessionId;
271
    }
272
273
    /**
274
     * Set allDay.
275
     *
276
     * @param int $allDay
277
     *
278
     * @return CCalendarEvent
279
     */
280
    public function setAllDay($allDay)
281
    {
282
        $this->allDay = $allDay;
283
284
        return $this;
285
    }
286
287
    /**
288
     * Get allDay.
289
     *
290
     * @return int
291
     */
292
    public function getAllDay()
293
    {
294
        return $this->allDay;
295
    }
296
297
    /**
298
     * Set id.
299
     *
300
     * @param int $id
301
     *
302
     * @return CCalendarEvent
303
     */
304
    public function setId($id)
305
    {
306
        $this->id = $id;
307
308
        return $this;
309
    }
310
311
    /**
312
     * Get id.
313
     *
314
     * @return int
315
     */
316
    public function getId()
317
    {
318
        return $this->id;
319
    }
320
321
    /**
322
     * Set cId.
323
     *
324
     * @param int $cId
325
     *
326
     * @return CCalendarEvent
327
     */
328
    public function setCId($cId)
329
    {
330
        $this->cId = $cId;
331
332
        return $this;
333
    }
334
335
    /**
336
     * Get cId.
337
     *
338
     * @return int
339
     */
340
    public function getCId()
341
    {
342
        return $this->cId;
343
    }
344
345
    /**
346
     * @return string
347
     */
348
    public function getComment()
349
    {
350
        return $this->comment;
351
    }
352
353
    /**
354
     * @param string $comment
355
     *
356
     * @return CCalendarEvent
357
     */
358
    public function setComment($comment)
359
    {
360
        $this->comment = $comment;
361
362
        return $this;
363
    }
364
365
    /**
366
     * @return Room
367
     */
368
    public function getRoom()
369
    {
370
        return $this->room;
371
    }
372
373
    /**
374
     * @param Room $room
375
     *
376
     * @return $this
377
     */
378
    public function setRoom($room)
379
    {
380
        $this->room = $room;
381
382
        return $this;
383
    }
384
385
    /**
386
     * @return string
387
     */
388
    public function getColor()
389
    {
390
        return $this->color;
391
    }
392
393
    /**
394
     * @param string $color
395
     *
396
     * @return $this
397
     */
398
    public function setColor($color)
399
    {
400
        $this->color = $color;
401
402
        return $this;
403
    }
404
405
    /**
406
     * @return int
407
     */
408
    public function getIid()
409
    {
410
        return $this->iid;
411
    }
412
413
    /**
414
     * @param int $iid
415
     *
416
     * @return CCalendarEvent
417
     */
418
    public function setIid($iid)
419
    {
420
        $this->iid = $iid;
421
422
        return $this;
423
    }
424
425
    /**
426
     * Resource identifier.
427
     */
428
    public function getResourceIdentifier(): int
429
    {
430
        return $this->getIid();
431
    }
432
433
    public function getResourceName(): string
434
    {
435
        return $this->getTitle();
436
    }
437
}
438