Passed
Push — master ( c87549...c35fdc )
by Julito
09:10
created

CNotebook::getResourceName()   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\AbstractResource;
8
use Chamilo\CoreBundle\Entity\ResourceInterface;
9
use Doctrine\ORM\Mapping as ORM;
10
use Gedmo\Mapping\Annotation as Gedmo;
11
12
/**
13
 * CNotebook.
14
 *
15
 * @ORM\Entity
16
 * @ORM\Table(
17
 *  name="c_notebook"
18
 * )
19
 */
20
class CNotebook extends AbstractResource implements ResourceInterface
21
{
22
    /**
23
     * @var int
24
     *
25
     * @ORM\Column(name="iid", type="integer")
26
     * @ORM\Id
27
     * @ORM\GeneratedValue
28
     */
29
    protected $iid;
30
31
    /**
32
     * @var int
33
     *
34
     * @ORM\Column(name="c_id", type="integer")
35
     */
36
    protected $cId;
37
38
    /**
39
     * @var int
40
     *
41
     * @ORM\Column(name="user_id", type="integer", nullable=false)
42
     */
43
    protected $userId;
44
45
    /**
46
     * @var string
47
     *
48
     * @ORM\Column(name="course", type="string", length=40, nullable=false)
49
     */
50
    protected $course;
51
52
    /**
53
     * @var int
54
     *
55
     * @ORM\Column(name="session_id", type="integer", nullable=false)
56
     */
57
    protected $sessionId;
58
59
    /**
60
     * @var string
61
     *
62
     * @ORM\Column(name="title", type="string", length=255, nullable=false)
63
     */
64
    protected $title;
65
66
    /**
67
     * @var string
68
     *
69
     * @ORM\Column(name="description", type="text", nullable=false)
70
     */
71
    protected $description;
72
73
    /**
74
     * @var \DateTime
75
     *
76
     * @Gedmo\Timestampable(on="create")
77
     *
78
     * @ORM\Column(name="creation_date", type="datetime", nullable=false)
79
     */
80
    protected $creationDate;
81
82
    /**
83
     * @var \DateTime
84
     *
85
     * @Gedmo\Timestampable(on="update")
86
     *
87
     * @ORM\Column(name="update_date", type="datetime", nullable=false)
88
     */
89
    protected $updateDate;
90
91
    /**
92
     * @var int
93
     *
94
     * @ORM\Column(name="status", type="integer", nullable=true)
95
     */
96
    protected $status;
97
98
    public function __construct()
99
    {
100
        $this->status = 0;
101
    }
102
103
    public function __toString(): string
104
    {
105
        return $this->getTitle();
106
    }
107
108
109
    /**
110
     * Set userId.
111
     *
112
     * @param int $userId
113
     *
114
     * @return CNotebook
115
     */
116
    public function setUserId($userId)
117
    {
118
        $this->userId = $userId;
119
120
        return $this;
121
    }
122
123
    /**
124
     * Get userId.
125
     *
126
     * @return int
127
     */
128
    public function getUserId()
129
    {
130
        return $this->userId;
131
    }
132
133
    /**
134
     * Set course.
135
     *
136
     * @param string $course
137
     *
138
     * @return CNotebook
139
     */
140
    public function setCourse($course)
141
    {
142
        $this->course = $course;
143
144
        return $this;
145
    }
146
147
    /**
148
     * Get course.
149
     *
150
     * @return string
151
     */
152
    public function getCourse()
153
    {
154
        return $this->course;
155
    }
156
157
    /**
158
     * Set sessionId.
159
     *
160
     * @param int $sessionId
161
     *
162
     * @return CNotebook
163
     */
164
    public function setSessionId($sessionId)
165
    {
166
        $this->sessionId = $sessionId;
167
168
        return $this;
169
    }
170
171
    /**
172
     * Get sessionId.
173
     *
174
     * @return int
175
     */
176
    public function getSessionId()
177
    {
178
        return $this->sessionId;
179
    }
180
181
    /**
182
     * Set title.
183
     *
184
     * @param string $title
185
     *
186
     * @return CNotebook
187
     */
188
    public function setTitle($title)
189
    {
190
        $this->title = $title;
191
192
        return $this;
193
    }
194
195
    /**
196
     * Get title.
197
     *
198
     * @return string
199
     */
200
    public function getTitle()
201
    {
202
        return (string) $this->title;
203
    }
204
205
    /**
206
     * Set description.
207
     *
208
     * @param string $description
209
     *
210
     * @return CNotebook
211
     */
212
    public function setDescription($description)
213
    {
214
        $this->description = $description;
215
216
        return $this;
217
    }
218
219
    /**
220
     * Get description.
221
     *
222
     * @return string
223
     */
224
    public function getDescription()
225
    {
226
        return $this->description;
227
    }
228
229
    /**
230
     * Set creationDate.
231
     *
232
     * @param \DateTime $creationDate
233
     *
234
     * @return CNotebook
235
     */
236
    public function setCreationDate($creationDate)
237
    {
238
        $this->creationDate = $creationDate;
239
240
        return $this;
241
    }
242
243
    /**
244
     * Get creationDate.
245
     *
246
     * @return \DateTime
247
     */
248
    public function getCreationDate()
249
    {
250
        return $this->creationDate;
251
    }
252
253
    /**
254
     * Set updateDate.
255
     *
256
     * @param \DateTime $updateDate
257
     *
258
     * @return CNotebook
259
     */
260
    public function setUpdateDate($updateDate)
261
    {
262
        $this->updateDate = $updateDate;
263
264
        return $this;
265
    }
266
267
    /**
268
     * Get updateDate.
269
     *
270
     * @return \DateTime
271
     */
272
    public function getUpdateDate()
273
    {
274
        return $this->updateDate;
275
    }
276
277
    /**
278
     * Set status.
279
     *
280
     * @param int $status
281
     *
282
     * @return CNotebook
283
     */
284
    public function setStatus($status)
285
    {
286
        $this->status = $status;
287
288
        return $this;
289
    }
290
291
    /**
292
     * Get status.
293
     *
294
     * @return int
295
     */
296
    public function getStatus()
297
    {
298
        return $this->status;
299
    }
300
301
    /**
302
     * Set cId.
303
     *
304
     * @param int $cId
305
     *
306
     * @return CNotebook
307
     */
308
    public function setCId($cId)
309
    {
310
        $this->cId = $cId;
311
312
        return $this;
313
    }
314
315
    /**
316
     * Get cId.
317
     *
318
     * @return int
319
     */
320
    public function getCId()
321
    {
322
        return $this->cId;
323
    }
324
325
    /**
326
     * Get iid.
327
     *
328
     * @return int
329
     */
330
    public function getIid()
331
    {
332
        return $this->iid;
333
    }
334
335
    public function getResourceIdentifier(): int
336
    {
337
        return $this->getIid();
338
    }
339
340
    public function getResourceName(): string
341
    {
342
        return $this->getTitle();
343
    }
344
345
    public function setResourceName(string $name): self
346
    {
347
        return $this->setTitle($name);
348
    }
349
}
350