Completed
Push — master ( d28136...3a5b5f )
by Julito
16:58
created

CAnnouncement::getResourceFieldName()   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
c 0
b 0
f 0
nop 0
dl 0
loc 3
rs 10
nc 1
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\CourseBundle\Entity;
5
6
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
7
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
8
use Doctrine\ORM\Mapping as ORM;
9
10
/**
11
 * CAnnouncement.
12
 *
13
 * @ORM\Table(
14
 *  name="c_announcement",
15
 *  indexes={
16
 *      @ORM\Index(name="course", columns={"c_id"}),
17
 *      @ORM\Index(name="session_id", columns={"session_id"})
18
 *  }
19
 * )
20
 * @ORM\Entity
21
 */
22
class CAnnouncement extends AbstractResource implements ResourceInterface
23
{
24
    /**
25
     * @var int
26
     *
27
     * @ORM\Column(name="iid", type="integer")
28
     * @ORM\Id
29
     * @ORM\GeneratedValue
30
     */
31
    protected $iid;
32
33
    /**
34
     * @var int
35
     *
36
     * @ORM\Column(name="id", type="integer", nullable=true)
37
     */
38
    protected $id;
39
40
    /**
41
     * @var int
42
     *
43
     * @ORM\Column(name="c_id", type="integer")
44
     */
45
    protected $cId;
46
47
    /**
48
     * @var string
49
     *
50
     * @ORM\Column(name="title", type="text", nullable=true)
51
     */
52
    protected $title;
53
54
    /**
55
     * @var string
56
     *
57
     * @ORM\Column(name="content", type="text", nullable=true)
58
     */
59
    protected $content;
60
61
    /**
62
     * @var \DateTime
63
     *
64
     * @ORM\Column(name="end_date", type="date", nullable=true)
65
     */
66
    protected $endDate;
67
68
    /**
69
     * @var int
70
     *
71
     * @ORM\Column(name="display_order", type="integer", nullable=false)
72
     */
73
    protected $displayOrder;
74
75
    /**
76
     * @var bool
77
     *
78
     * @ORM\Column(name="email_sent", type="boolean", nullable=true)
79
     */
80
    protected $emailSent;
81
82
    /**
83
     * @var int
84
     *
85
     * @ORM\Column(name="session_id", type="integer", nullable=true)
86
     */
87
    protected $sessionId;
88
89
    /**
90
     * Set title.
91
     *
92
     * @param string $title
93
     *
94
     * @return CAnnouncement
95
     */
96
    public function setTitle($title)
97
    {
98
        $this->title = $title;
99
100
        return $this;
101
    }
102
103
    /**
104
     * Get title.
105
     *
106
     * @return string
107
     */
108
    public function getTitle()
109
    {
110
        return (string) $this->title;
111
    }
112
113
    /**
114
     * Set content.
115
     *
116
     * @param string $content
117
     *
118
     * @return CAnnouncement
119
     */
120
    public function setContent($content)
121
    {
122
        $this->content = $content;
123
124
        return $this;
125
    }
126
127
    /**
128
     * Get content.
129
     *
130
     * @return string
131
     */
132
    public function getContent()
133
    {
134
        return $this->content;
135
    }
136
137
    /**
138
     * Set endDate.
139
     *
140
     * @param \DateTime $endDate
141
     *
142
     * @return CAnnouncement
143
     */
144
    public function setEndDate($endDate)
145
    {
146
        $this->endDate = $endDate;
147
148
        return $this;
149
    }
150
151
    /**
152
     * Get endDate.
153
     *
154
     * @return \DateTime
155
     */
156
    public function getEndDate()
157
    {
158
        return $this->endDate;
159
    }
160
161
    /**
162
     * Set displayOrder.
163
     *
164
     * @param int $displayOrder
165
     *
166
     * @return CAnnouncement
167
     */
168
    public function setDisplayOrder($displayOrder)
169
    {
170
        $this->displayOrder = $displayOrder;
171
172
        return $this;
173
    }
174
175
    /**
176
     * Get displayOrder.
177
     *
178
     * @return int
179
     */
180
    public function getDisplayOrder()
181
    {
182
        return $this->displayOrder;
183
    }
184
185
    /**
186
     * Set emailSent.
187
     *
188
     * @param bool $emailSent
189
     *
190
     * @return CAnnouncement
191
     */
192
    public function setEmailSent($emailSent)
193
    {
194
        $this->emailSent = $emailSent;
195
196
        return $this;
197
    }
198
199
    /**
200
     * Get emailSent.
201
     *
202
     * @return bool
203
     */
204
    public function getEmailSent()
205
    {
206
        return $this->emailSent;
207
    }
208
209
    /**
210
     * Set sessionId.
211
     *
212
     * @param int $sessionId
213
     *
214
     * @return CAnnouncement
215
     */
216
    public function setSessionId($sessionId)
217
    {
218
        $this->sessionId = $sessionId;
219
220
        return $this;
221
    }
222
223
    /**
224
     * Get sessionId.
225
     *
226
     * @return int
227
     */
228
    public function getSessionId()
229
    {
230
        return $this->sessionId;
231
    }
232
233
    /**
234
     * Set id.
235
     *
236
     * @param int $id
237
     *
238
     * @return CAnnouncement
239
     */
240
    public function setId($id)
241
    {
242
        $this->id = $id;
243
244
        return $this;
245
    }
246
247
    /**
248
     * Get id.
249
     *
250
     * @return int
251
     */
252
    public function getId()
253
    {
254
        return $this->id;
255
    }
256
257
    /**
258
     * Set cId.
259
     *
260
     * @param int $cId
261
     *
262
     * @return CAnnouncement
263
     */
264
    public function setCId($cId)
265
    {
266
        $this->cId = $cId;
267
268
        return $this;
269
    }
270
271
    /**
272
     * Get cId.
273
     *
274
     * @return int
275
     */
276
    public function getCId()
277
    {
278
        return $this->cId;
279
    }
280
281
    /**
282
     * Get iid.
283
     *
284
     * @return int
285
     */
286
    public function getIid()
287
    {
288
        return $this->iid;
289
    }
290
291
    /**
292
     * Resource identifier.
293
     */
294
    public function getResourceIdentifier(): int
295
    {
296
        return $this->getIid();
297
    }
298
299
    public function getResourceName(): string
300
    {
301
        return $this->getTitle();
302
    }
303
304
    public function __toString(): string
305
    {
306
        return $this->getTitle();
307
    }
308
}
309