Passed
Push — master ( 8d1a37...25babe )
by Julito
22:45
created

CSurveyInvitation::setSurveyCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
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
 *         @ORM\Index(name="idx_survey_inv_code", columns={"survey_code"})
22
 *     }
23
 * )
24
 * @ORM\Entity
25
 */
26
class CSurveyInvitation
27
{
28
    /**
29
     * @ORM\Column(name="iid", type="integer")
30
     * @ORM\Id
31
     * @ORM\GeneratedValue
32
     */
33
    protected int $iid;
34
35
    /**
36
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course")
37
     * @ORM\JoinColumn(name="c_id", referencedColumnName="id", nullable=true, onDelete="CASCADE")
38
     */
39
    protected ?Course $course = null;
40
41
    /**
42
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Session", inversedBy="resourceLinks")
43
     * @ORM\JoinColumn(name="session_id", referencedColumnName="id", nullable=true, onDelete="CASCADE")
44
     */
45
    protected ?Session $session = null;
46
47
    /**
48
     * @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CGroup")
49
     * @ORM\JoinColumn(name="group_id", referencedColumnName="iid", nullable=true, onDelete="CASCADE")
50
     */
51
    protected ?CGroup $group = null;
52
53
    /**
54
     * @ORM\Column(name="survey_code", type="string", length=20, nullable=false)
55
     */
56
    protected string $surveyCode;
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 setSurveyCode(string $surveyCode): self
89
    {
90
        $this->surveyCode = $surveyCode;
91
92
        return $this;
93
    }
94
95
    /**
96
     * Get surveyCode.
97
     *
98
     * @return string
99
     */
100
    public function getSurveyCode()
101
    {
102
        return $this->surveyCode;
103
    }
104
105
    public function setUser(string $user): self
106
    {
107
        $this->user = $user;
108
109
        return $this;
110
    }
111
112
    /**
113
     * Get user.
114
     *
115
     * @return string
116
     */
117
    public function getUser()
118
    {
119
        return $this->user;
120
    }
121
122
    public function setInvitationCode(string $invitationCode): self
123
    {
124
        $this->invitationCode = $invitationCode;
125
126
        return $this;
127
    }
128
129
    /**
130
     * Get invitationCode.
131
     *
132
     * @return string
133
     */
134
    public function getInvitationCode()
135
    {
136
        return $this->invitationCode;
137
    }
138
139
    public function setInvitationDate(DateTime $invitationDate): self
140
    {
141
        $this->invitationDate = $invitationDate;
142
143
        return $this;
144
    }
145
146
    /**
147
     * Get invitationDate.
148
     *
149
     * @return DateTime
150
     */
151
    public function getInvitationDate()
152
    {
153
        return $this->invitationDate;
154
    }
155
156
    public function setReminderDate(DateTime $reminderDate): self
157
    {
158
        $this->reminderDate = $reminderDate;
159
160
        return $this;
161
    }
162
163
    /**
164
     * Get reminderDate.
165
     *
166
     * @return DateTime
167
     */
168
    public function getReminderDate()
169
    {
170
        return $this->reminderDate;
171
    }
172
173
    public function setAnswered(int $answered): self
174
    {
175
        $this->answered = $answered;
176
177
        return $this;
178
    }
179
180
    /**
181
     * Get answered.
182
     *
183
     * @return int
184
     */
185
    public function getAnswered()
186
    {
187
        return $this->answered;
188
    }
189
190
    public function getAnsweredAt(): DateTime
191
    {
192
        return $this->answeredAt;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->answeredAt could return the type null which is incompatible with the type-hinted return DateTime. Consider adding an additional type-check to rule them out.
Loading history...
193
    }
194
195
    public function setAnsweredAt(DateTime $answeredAt): self
196
    {
197
        $this->answeredAt = $answeredAt;
198
199
        return $this;
200
    }
201
202
    public function getCourse(): ?Course
203
    {
204
        return $this->course;
205
    }
206
207
    public function setCourse(?Course $course): self
208
    {
209
        $this->course = $course;
210
211
        return $this;
212
    }
213
214
    public function getSession(): ?Session
215
    {
216
        return $this->session;
217
    }
218
219
    public function setSession(?Session $session): self
220
    {
221
        $this->session = $session;
222
223
        return $this;
224
    }
225
226
    public function getGroup(): ?CGroup
227
    {
228
        return $this->group;
229
    }
230
231
    public function setGroup(?CGroup $group): self
232
    {
233
        $this->group = $group;
234
235
        return $this;
236
    }
237
}
238