|
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 Chamilo\CoreBundle\Entity\Course; |
|
10
|
|
|
use Chamilo\CoreBundle\Entity\Session; |
|
11
|
|
|
use DateTime; |
|
12
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
13
|
|
|
|
|
14
|
|
|
/** |
|
15
|
|
|
* CSurveyInvitation. |
|
16
|
|
|
* |
|
17
|
|
|
* @ORM\Table( |
|
18
|
|
|
* name="c_survey_invitation", |
|
19
|
|
|
* indexes={ |
|
20
|
|
|
* @ORM\Index(name="course", columns={"c_id"}), |
|
21
|
|
|
* } |
|
22
|
|
|
* ) |
|
23
|
|
|
* @ORM\Entity |
|
24
|
|
|
*/ |
|
25
|
|
|
class CSurveyInvitation |
|
26
|
|
|
{ |
|
27
|
|
|
/** |
|
28
|
|
|
* @ORM\Column(name="iid", type="integer") |
|
29
|
|
|
* @ORM\Id |
|
30
|
|
|
* @ORM\GeneratedValue |
|
31
|
|
|
*/ |
|
32
|
|
|
protected int $iid; |
|
33
|
|
|
|
|
34
|
|
|
/** |
|
35
|
|
|
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course") |
|
36
|
|
|
* @ORM\JoinColumn(name="c_id", referencedColumnName="id", nullable=true, onDelete="CASCADE") |
|
37
|
|
|
*/ |
|
38
|
|
|
protected ?Course $course = null; |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Session", inversedBy="resourceLinks") |
|
42
|
|
|
* @ORM\JoinColumn(name="session_id", referencedColumnName="id", nullable=true, onDelete="CASCADE") |
|
43
|
|
|
*/ |
|
44
|
|
|
protected ?Session $session = null; |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CGroup") |
|
48
|
|
|
* @ORM\JoinColumn(name="group_id", referencedColumnName="iid", nullable=true, onDelete="CASCADE") |
|
49
|
|
|
*/ |
|
50
|
|
|
protected ?CGroup $group = null; |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* @ORM\ManyToOne(targetEntity="CSurvey", inversedBy="invitations") |
|
54
|
|
|
* @ORM\JoinColumn(name="survey_id", referencedColumnName="iid") |
|
55
|
|
|
*/ |
|
56
|
|
|
protected CSurvey $survey; |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* @ORM\Column(name="user", type="string", length=250, nullable=false) |
|
60
|
|
|
*/ |
|
61
|
|
|
protected string $user; |
|
62
|
|
|
|
|
63
|
|
|
/** |
|
64
|
|
|
* @ORM\Column(name="invitation_code", type="string", length=250, nullable=false) |
|
65
|
|
|
*/ |
|
66
|
|
|
protected string $invitationCode; |
|
67
|
|
|
|
|
68
|
|
|
/** |
|
69
|
|
|
* @ORM\Column(name="answered", type="integer", nullable=false) |
|
70
|
|
|
*/ |
|
71
|
|
|
protected int $answered; |
|
72
|
|
|
|
|
73
|
|
|
/** |
|
74
|
|
|
* @ORM\Column(name="invitation_date", type="datetime", nullable=false) |
|
75
|
|
|
*/ |
|
76
|
|
|
protected DateTime $invitationDate; |
|
77
|
|
|
|
|
78
|
|
|
/** |
|
79
|
|
|
* @ORM\Column(name="reminder_date", type="datetime", nullable=true) |
|
80
|
|
|
*/ |
|
81
|
|
|
protected ?DateTime $reminderDate = null; |
|
82
|
|
|
|
|
83
|
|
|
/** |
|
84
|
|
|
* @ORM\Column(name="answered_at", type="datetime", nullable=true) |
|
85
|
|
|
*/ |
|
86
|
|
|
protected ?DateTime $answeredAt = null; |
|
87
|
|
|
|
|
88
|
|
|
public function __construct() |
|
89
|
|
|
{ |
|
90
|
|
|
$this->answered = 0; |
|
91
|
|
|
$this->invitationDate = new DateTime(); |
|
92
|
|
|
} |
|
93
|
|
|
|
|
94
|
|
|
public function getSurvey(): CSurvey |
|
95
|
|
|
{ |
|
96
|
|
|
return $this->survey; |
|
97
|
|
|
} |
|
98
|
|
|
|
|
99
|
|
|
public function setSurvey(CSurvey $survey): self |
|
100
|
|
|
{ |
|
101
|
|
|
$this->survey = $survey; |
|
102
|
|
|
|
|
103
|
|
|
return $this; |
|
104
|
|
|
} |
|
105
|
|
|
|
|
106
|
|
|
public function setUser(string $user): self |
|
107
|
|
|
{ |
|
108
|
|
|
$this->user = $user; |
|
109
|
|
|
|
|
110
|
|
|
return $this; |
|
111
|
|
|
} |
|
112
|
|
|
|
|
113
|
|
|
/** |
|
114
|
|
|
* Get user. |
|
115
|
|
|
* |
|
116
|
|
|
* @return string |
|
117
|
|
|
*/ |
|
118
|
|
|
public function getUser() |
|
119
|
|
|
{ |
|
120
|
|
|
return $this->user; |
|
121
|
|
|
} |
|
122
|
|
|
|
|
123
|
|
|
public function setInvitationCode(string $invitationCode): self |
|
124
|
|
|
{ |
|
125
|
|
|
$this->invitationCode = $invitationCode; |
|
126
|
|
|
|
|
127
|
|
|
return $this; |
|
128
|
|
|
} |
|
129
|
|
|
|
|
130
|
|
|
/** |
|
131
|
|
|
* Get invitationCode. |
|
132
|
|
|
* |
|
133
|
|
|
* @return string |
|
134
|
|
|
*/ |
|
135
|
|
|
public function getInvitationCode() |
|
136
|
|
|
{ |
|
137
|
|
|
return $this->invitationCode; |
|
138
|
|
|
} |
|
139
|
|
|
|
|
140
|
|
|
public function setInvitationDate(DateTime $invitationDate): self |
|
141
|
|
|
{ |
|
142
|
|
|
$this->invitationDate = $invitationDate; |
|
143
|
|
|
|
|
144
|
|
|
return $this; |
|
145
|
|
|
} |
|
146
|
|
|
|
|
147
|
|
|
/** |
|
148
|
|
|
* Get invitationDate. |
|
149
|
|
|
* |
|
150
|
|
|
* @return DateTime |
|
151
|
|
|
*/ |
|
152
|
|
|
public function getInvitationDate() |
|
153
|
|
|
{ |
|
154
|
|
|
return $this->invitationDate; |
|
155
|
|
|
} |
|
156
|
|
|
|
|
157
|
|
|
public function setReminderDate(DateTime $reminderDate): self |
|
158
|
|
|
{ |
|
159
|
|
|
$this->reminderDate = $reminderDate; |
|
160
|
|
|
|
|
161
|
|
|
return $this; |
|
162
|
|
|
} |
|
163
|
|
|
|
|
164
|
|
|
/** |
|
165
|
|
|
* Get reminderDate. |
|
166
|
|
|
* |
|
167
|
|
|
* @return DateTime |
|
168
|
|
|
*/ |
|
169
|
|
|
public function getReminderDate() |
|
170
|
|
|
{ |
|
171
|
|
|
return $this->reminderDate; |
|
172
|
|
|
} |
|
173
|
|
|
|
|
174
|
|
|
public function setAnswered(int $answered): self |
|
175
|
|
|
{ |
|
176
|
|
|
$this->answered = $answered; |
|
177
|
|
|
|
|
178
|
|
|
return $this; |
|
179
|
|
|
} |
|
180
|
|
|
|
|
181
|
|
|
/** |
|
182
|
|
|
* Get answered. |
|
183
|
|
|
* |
|
184
|
|
|
* @return int |
|
185
|
|
|
*/ |
|
186
|
|
|
public function getAnswered() |
|
187
|
|
|
{ |
|
188
|
|
|
return $this->answered; |
|
189
|
|
|
} |
|
190
|
|
|
|
|
191
|
|
|
public function getAnsweredAt(): DateTime |
|
192
|
|
|
{ |
|
193
|
|
|
return $this->answeredAt; |
|
|
|
|
|
|
194
|
|
|
} |
|
195
|
|
|
|
|
196
|
|
|
public function setAnsweredAt(DateTime $answeredAt): self |
|
197
|
|
|
{ |
|
198
|
|
|
$this->answeredAt = $answeredAt; |
|
199
|
|
|
|
|
200
|
|
|
return $this; |
|
201
|
|
|
} |
|
202
|
|
|
|
|
203
|
|
|
public function getCourse(): ?Course |
|
204
|
|
|
{ |
|
205
|
|
|
return $this->course; |
|
206
|
|
|
} |
|
207
|
|
|
|
|
208
|
|
|
public function setCourse(?Course $course): self |
|
209
|
|
|
{ |
|
210
|
|
|
$this->course = $course; |
|
211
|
|
|
|
|
212
|
|
|
return $this; |
|
213
|
|
|
} |
|
214
|
|
|
|
|
215
|
|
|
public function getSession(): ?Session |
|
216
|
|
|
{ |
|
217
|
|
|
return $this->session; |
|
218
|
|
|
} |
|
219
|
|
|
|
|
220
|
|
|
public function setSession(?Session $session): self |
|
221
|
|
|
{ |
|
222
|
|
|
$this->session = $session; |
|
223
|
|
|
|
|
224
|
|
|
return $this; |
|
225
|
|
|
} |
|
226
|
|
|
|
|
227
|
|
|
public function getGroup(): ?CGroup |
|
228
|
|
|
{ |
|
229
|
|
|
return $this->group; |
|
230
|
|
|
} |
|
231
|
|
|
|
|
232
|
|
|
public function setGroup(?CGroup $group): self |
|
233
|
|
|
{ |
|
234
|
|
|
$this->group = $group; |
|
235
|
|
|
|
|
236
|
|
|
return $this; |
|
237
|
|
|
} |
|
238
|
|
|
} |
|
239
|
|
|
|