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

SysAnnouncement::setContent()   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\CoreBundle\Entity;
8
9
use DateTime;
10
use Doctrine\ORM\Mapping as ORM;
11
use Symfony\Component\Validator\Constraints as Assert;
12
13
/**
14
 * SysAnnouncement.
15
 *
16
 * @ORM\Table(name="sys_announcement")
17
 * @ORM\Entity
18
 */
19
class SysAnnouncement
20
{
21
    /**
22
     * @ORM\Column(name="id", type="integer")
23
     * @ORM\Id
24
     * @ORM\GeneratedValue()
25
     */
26
    protected int $id;
27
28
    /**
29
     * @ORM\Column(name="date_start", type="datetime", nullable=false)
30
     */
31
    protected DateTime $dateStart;
32
33
    /**
34
     * @ORM\Column(name="date_end", type="datetime", nullable=false)
35
     */
36
    protected DateTime $dateEnd;
37
38
    /**
39
     * @ORM\Column(name="visible_teacher", type="boolean", nullable=false)
40
     */
41
    protected bool $visibleTeacher;
42
43
    /**
44
     * @ORM\Column(name="visible_student", type="boolean", nullable=false)
45
     */
46
    protected bool $visibleStudent;
47
48
    /**
49
     * @ORM\Column(name="visible_guest", type="boolean", nullable=false)
50
     */
51
    protected bool $visibleGuest;
52
53
    /**
54
     * @ORM\Column(name="visible_drh", type="boolean", nullable=false)
55
     */
56
    protected bool $visibleDrh;
57
58
    /**
59
     * @ORM\Column(name="visible_session_admin", type="boolean", nullable=false)
60
     */
61
    protected bool $visibleSessionAdmin;
62
63
    /**
64
     * @ORM\Column(name="visible_boss", type="boolean", nullable=false)
65
     */
66
    protected bool $visibleBoss;
67
68
    /**
69
     * @Assert\NotBlank()
70
     *
71
     * @ORM\Column(name="title", type="string", length=250, nullable=false)
72
     */
73
    protected string $title;
74
75
    /**
76
     * @Assert\NotBlank()
77
     *
78
     * @ORM\Column(name="content", type="text", nullable=false)
79
     */
80
    protected string $content;
81
82
    /**
83
     * @ORM\Column(name="lang", type="string", length=70, nullable=true)
84
     */
85
    protected ?string $lang = null;
86
87
    /**
88
     * @ORM\ManyToOne(targetEntity="AccessUrl")
89
     * @ORM\JoinColumn(name="access_url_id", referencedColumnName="id", onDelete="CASCADE")
90
     */
91
    protected AccessUrl $url;
92
93
    /**
94
     * @ORM\Column(name="career_id", type="integer", nullable=true)
95
     */
96
    protected ?int $careerId;
97
98
    /**
99
     * @ORM\Column(name="promotion_id", type="integer", nullable=true)
100
     */
101
    protected ?int $promotionId;
102
103
    public function __construct()
104
    {
105
        $this->visibleBoss = false;
106
        $this->visibleDrh = false;
107
        $this->visibleGuest = false;
108
        $this->visibleSessionAdmin = false;
109
        $this->visibleStudent = false;
110
        $this->visibleTeacher = false;
111
        $this->careerId = 0;
112
        $this->promotionId = 0;
113
    }
114
115
    /**
116
     * Get dateStart.
117
     *
118
     * @return DateTime
119
     */
120
    public function getDateStart()
121
    {
122
        return $this->dateStart;
123
    }
124
125
    public function setDateStart(DateTime $dateStart): self
126
    {
127
        $this->dateStart = $dateStart;
128
129
        return $this;
130
    }
131
132
    /**
133
     * Get dateEnd.
134
     *
135
     * @return DateTime
136
     */
137
    public function getDateEnd()
138
    {
139
        return $this->dateEnd;
140
    }
141
142
    public function setDateEnd(DateTime $dateEnd): self
143
    {
144
        $this->dateEnd = $dateEnd;
145
146
        return $this;
147
    }
148
149
    /**
150
     * Get visibleTeacher.
151
     *
152
     * @return bool
153
     */
154
    public function getVisibleTeacher()
155
    {
156
        return $this->visibleTeacher;
157
    }
158
159
    public function setVisibleTeacher(bool $visibleTeacher): self
160
    {
161
        $this->visibleTeacher = $visibleTeacher;
162
163
        return $this;
164
    }
165
166
    /**
167
     * Get visibleStudent.
168
     *
169
     * @return bool
170
     */
171
    public function getVisibleStudent()
172
    {
173
        return $this->visibleStudent;
174
    }
175
176
    public function setVisibleStudent(bool $visibleStudent): self
177
    {
178
        $this->visibleStudent = $visibleStudent;
179
180
        return $this;
181
    }
182
183
    /**
184
     * Get visibleGuest.
185
     *
186
     * @return bool
187
     */
188
    public function getVisibleGuest()
189
    {
190
        return $this->visibleGuest;
191
    }
192
193
    public function setVisibleGuest(bool $visibleGuest): self
194
    {
195
        $this->visibleGuest = $visibleGuest;
196
197
        return $this;
198
    }
199
200
    /**
201
     * Get title.
202
     *
203
     * @return string
204
     */
205
    public function getTitle()
206
    {
207
        return $this->title;
208
    }
209
210
    public function setTitle(string $title): self
211
    {
212
        $this->title = $title;
213
214
        return $this;
215
    }
216
217
    /**
218
     * Get content.
219
     *
220
     * @return string
221
     */
222
    public function getContent()
223
    {
224
        return $this->content;
225
    }
226
227
    public function setContent(string $content): self
228
    {
229
        $this->content = $content;
230
231
        return $this;
232
    }
233
234
    /**
235
     * Get lang.
236
     *
237
     * @return string
238
     */
239
    public function getLang()
240
    {
241
        return $this->lang;
242
    }
243
244
    public function setLang(string $lang): self
245
    {
246
        $this->lang = $lang;
247
248
        return $this;
249
    }
250
251
    /**
252
     * Get id.
253
     *
254
     * @return int
255
     */
256
    public function getId()
257
    {
258
        return $this->id;
259
    }
260
261
    public function isVisibleDrh(): bool
262
    {
263
        return $this->visibleDrh;
264
    }
265
266
    public function setVisibleDrh(bool $visibleDrh): self
267
    {
268
        $this->visibleDrh = $visibleDrh;
269
270
        return $this;
271
    }
272
273
    public function isVisibleSessionAdmin(): bool
274
    {
275
        return $this->visibleSessionAdmin;
276
    }
277
278
    public function setVisibleSessionAdmin(bool $visibleSessionAdmin): self
279
    {
280
        $this->visibleSessionAdmin = $visibleSessionAdmin;
281
282
        return $this;
283
    }
284
285
    public function isVisibleBoss(): bool
286
    {
287
        return $this->visibleBoss;
288
    }
289
290
    public function setVisibleBoss(bool $visibleBoss): self
291
    {
292
        $this->visibleBoss = $visibleBoss;
293
294
        return $this;
295
    }
296
297
    public function getUrl(): AccessUrl
298
    {
299
        return $this->url;
300
    }
301
302
    public function setUrl(AccessUrl $url): self
303
    {
304
        $this->url = $url;
305
306
        return $this;
307
    }
308
}
309