Passed
Push — master ( 0c5975...84e769 )
by Julito
21:43
created

CAnnouncement::getContent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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\CourseBundle\Repository\CAnnouncementAttachmentRepository;
10
use Doctrine\ORM\Mapping as ORM;
11
12
/**
13
 * CAnnouncement.
14
 *
15
 * @ORM\Table(
16
 *  name="c_announcement",
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 CAnnouncement 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="text", nullable=true)
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="end_date", type="date", nullable=true)
67
     */
68
    protected $endDate;
69
70
    /**
71
     * @var int
72
     *
73
     * @ORM\Column(name="display_order", type="integer", nullable=false)
74
     */
75
    protected $displayOrder;
76
77
    /**
78
     * @var bool
79
     *
80
     * @ORM\Column(name="email_sent", type="boolean", nullable=true)
81
     */
82
    protected $emailSent;
83
84
    /**
85
     * @var int
86
     *
87
     * @ORM\Column(name="session_id", type="integer", nullable=true)
88
     */
89
    protected $sessionId;
90
91
    /**
92
     * @var CAnnouncementAttachment[]
93
     *
94
     * @ORM\OneToMany(targetEntity="Chamilo\CourseBundle\Entity\CAnnouncementAttachment", mappedBy="announcement", cascade={"persist", "remove"}, orphanRemoval=true)
95
     */
96
    protected $attachments;
97
98
    public function __toString(): string
99
    {
100
        return $this->getTitle();
101
    }
102
103
    /**
104
     * @return CAnnouncementAttachment[]
105
     */
106
    public function getAttachments()
107
    {
108
        return $this->attachments;
109
    }
110
111
    /**
112
     * @param CAnnouncementAttachment[] $attachments
113
     *
114
     * @return CAnnouncement
115
     */
116
    public function setAttachments(array $attachments): CAnnouncement
117
    {
118
        $this->attachments = $attachments;
119
120
        return $this;
121
    }
122
123
    /**
124
     * Set title.
125
     *
126
     * @param string $title
127
     *
128
     * @return CAnnouncement
129
     */
130
    public function setTitle($title)
131
    {
132
        $this->title = $title;
133
134
        return $this;
135
    }
136
137
    /**
138
     * Get title.
139
     *
140
     * @return string
141
     */
142
    public function getTitle()
143
    {
144
        return (string) $this->title;
145
    }
146
147
    /**
148
     * Set content.
149
     *
150
     * @param string $content
151
     *
152
     * @return CAnnouncement
153
     */
154
    public function setContent($content)
155
    {
156
        $this->content = $content;
157
158
        return $this;
159
    }
160
161
    /**
162
     * Get content.
163
     *
164
     * @return string
165
     */
166
    public function getContent()
167
    {
168
        return $this->content;
169
    }
170
171
    /**
172
     * Set endDate.
173
     *
174
     * @param \DateTime $endDate
175
     *
176
     * @return CAnnouncement
177
     */
178
    public function setEndDate($endDate)
179
    {
180
        $this->endDate = $endDate;
181
182
        return $this;
183
    }
184
185
    /**
186
     * Get endDate.
187
     *
188
     * @return \DateTime
189
     */
190
    public function getEndDate()
191
    {
192
        return $this->endDate;
193
    }
194
195
    /**
196
     * Set displayOrder.
197
     *
198
     * @param int $displayOrder
199
     *
200
     * @return CAnnouncement
201
     */
202
    public function setDisplayOrder($displayOrder)
203
    {
204
        $this->displayOrder = $displayOrder;
205
206
        return $this;
207
    }
208
209
    /**
210
     * Get displayOrder.
211
     *
212
     * @return int
213
     */
214
    public function getDisplayOrder()
215
    {
216
        return $this->displayOrder;
217
    }
218
219
    /**
220
     * Set emailSent.
221
     *
222
     * @param bool $emailSent
223
     *
224
     * @return CAnnouncement
225
     */
226
    public function setEmailSent($emailSent)
227
    {
228
        $this->emailSent = $emailSent;
229
230
        return $this;
231
    }
232
233
    /**
234
     * Get emailSent.
235
     *
236
     * @return bool
237
     */
238
    public function getEmailSent()
239
    {
240
        return $this->emailSent;
241
    }
242
243
    /**
244
     * Set sessionId.
245
     *
246
     * @param int $sessionId
247
     *
248
     * @return CAnnouncement
249
     */
250
    public function setSessionId($sessionId)
251
    {
252
        $this->sessionId = $sessionId;
253
254
        return $this;
255
    }
256
257
    /**
258
     * Get sessionId.
259
     *
260
     * @return int
261
     */
262
    public function getSessionId()
263
    {
264
        return $this->sessionId;
265
    }
266
267
    /**
268
     * Set id.
269
     *
270
     * @param int $id
271
     *
272
     * @return CAnnouncement
273
     */
274
    public function setId($id)
275
    {
276
        $this->id = $id;
277
278
        return $this;
279
    }
280
281
    /**
282
     * Get id.
283
     *
284
     * @return int
285
     */
286
    public function getId()
287
    {
288
        return $this->id;
289
    }
290
291
    /**
292
     * Set cId.
293
     *
294
     * @param int $cId
295
     *
296
     * @return CAnnouncement
297
     */
298
    public function setCId($cId)
299
    {
300
        $this->cId = $cId;
301
302
        return $this;
303
    }
304
305
    /**
306
     * Get cId.
307
     *
308
     * @return int
309
     */
310
    public function getCId()
311
    {
312
        return $this->cId;
313
    }
314
315
    /**
316
     * Get iid.
317
     *
318
     * @return int
319
     */
320
    public function getIid()
321
    {
322
        return $this->iid;
323
    }
324
325
    /**
326
     * Resource identifier.
327
     */
328
    public function getResourceIdentifier(): int
329
    {
330
        return $this->getIid();
331
    }
332
333
    public function getResourceName(): string
334
    {
335
        return $this->getTitle();
336
    }
337
}
338