1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* For licensing terms, see /license.txt */ |
6
|
|
|
|
7
|
|
|
namespace Chamilo\CourseBundle\Entity; |
8
|
|
|
|
9
|
|
|
use DateTime; |
10
|
|
|
use Doctrine\Common\Collections\Collection; |
11
|
|
|
use Doctrine\ORM\Mapping as ORM; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* @ORM\Table( |
15
|
|
|
* name="c_attendance_calendar", |
16
|
|
|
* indexes={ |
17
|
|
|
* @ORM\Index(name="done_attendance", columns={"done_attendance"}) |
18
|
|
|
* } |
19
|
|
|
* ) |
20
|
|
|
* @ORM\Entity |
21
|
|
|
*/ |
22
|
|
|
class CAttendanceCalendar |
23
|
|
|
{ |
24
|
|
|
/** |
25
|
|
|
* @ORM\Column(name="iid", type="integer") |
26
|
|
|
* @ORM\Id |
27
|
|
|
* @ORM\GeneratedValue |
28
|
|
|
*/ |
29
|
|
|
protected int $iid; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @ORM\ManyToOne(targetEntity="CAttendance", inversedBy="calendars", cascade={"remove"}) |
33
|
|
|
* @ORM\JoinColumn(name="attendance_id", referencedColumnName="iid", onDelete="CASCADE") |
34
|
|
|
*/ |
35
|
|
|
protected CAttendance $attendance; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @ORM\Column(name="date_time", type="datetime", nullable=false) |
39
|
|
|
*/ |
40
|
|
|
protected DateTime $dateTime; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* @ORM\Column(name="done_attendance", type="boolean", nullable=false) |
44
|
|
|
*/ |
45
|
|
|
protected bool $doneAttendance; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @var Collection|CAttendanceSheet[] |
49
|
|
|
* |
50
|
|
|
* @ORM\OneToMany(targetEntity="CAttendanceSheet", mappedBy="attendanceCalendar", cascade={"persist", "remove"}) |
51
|
|
|
*/ |
52
|
|
|
protected Collection $sheets; |
53
|
|
|
|
54
|
|
|
public function getIid(): int |
55
|
|
|
{ |
56
|
|
|
return $this->iid; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
public function getAttendance(): CAttendance |
60
|
|
|
{ |
61
|
|
|
return $this->attendance; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
public function setAttendance(CAttendance $attendance): self |
65
|
|
|
{ |
66
|
|
|
$this->attendance = $attendance; |
67
|
|
|
|
68
|
|
|
return $this; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
public function setDateTime(DateTime $dateTime): self |
72
|
|
|
{ |
73
|
|
|
$this->dateTime = $dateTime; |
74
|
|
|
|
75
|
|
|
return $this; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* Get dateTime. |
80
|
|
|
* |
81
|
|
|
* @return DateTime |
82
|
|
|
*/ |
83
|
|
|
public function getDateTime() |
84
|
|
|
{ |
85
|
|
|
return $this->dateTime; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
public function setDoneAttendance(bool $doneAttendance): self |
89
|
|
|
{ |
90
|
|
|
$this->doneAttendance = $doneAttendance; |
91
|
|
|
|
92
|
|
|
return $this; |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
public function getDoneAttendance(): bool |
96
|
|
|
{ |
97
|
|
|
return $this->doneAttendance; |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* @return CAttendanceSheet[]|Collection |
102
|
|
|
*/ |
103
|
|
|
public function getSheets() |
104
|
|
|
{ |
105
|
|
|
return $this->sheets; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* @param CAttendanceSheet[]|Collection $sheets |
110
|
|
|
*/ |
111
|
|
|
public function setSheets(Collection $sheets): self |
112
|
|
|
{ |
113
|
|
|
$this->sheets = $sheets; |
114
|
|
|
|
115
|
|
|
return $this; |
116
|
|
|
} |
117
|
|
|
} |
118
|
|
|
|