Passed
Push — master ( 164a3a...6f5f89 )
by Julito
13:30
created

CLink::getIid()   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
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
namespace Chamilo\CourseBundle\Entity;
6
7
use APY\DataGridBundle\Grid\Mapping as GRID;
8
use Chamilo\CoreBundle\Entity\Resource\AbstractResource;
9
use Chamilo\CoreBundle\Entity\Resource\ResourceInterface;
10
use Doctrine\ORM\Mapping as ORM;
11
12
/**
13
 * CLink.
14
 *
15
 * @ORM\Table(
16
 *  name="c_link",
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
 * @GRID\Source(columns="iid, title, resourceNode.createdAt", filterable=false, groups={"resource"})
24
 */
25
class CLink extends AbstractResource implements ResourceInterface
26
{
27
    /**
28
     * @var int
29
     *
30
     * @ORM\Column(name="iid", type="integer")
31
     * @ORM\Id
32
     * @ORM\GeneratedValue
33
     */
34
    protected $iid;
35
36
    /**
37
     * @var int
38
     *
39
     * @ORM\Column(name="c_id", type="integer")
40
     */
41
    protected $cId;
42
43
    /**
44
     * @var int
45
     *
46
     * @ORM\Column(name="id", type="integer", nullable=true)
47
     */
48
    protected $id;
49
50
    /**
51
     * @var string
52
     *
53
     * @ORM\Column(name="url", type="text", nullable=false)
54
     */
55
    protected $url;
56
57
    /**
58
     * @var string
59
     *
60
     * @ORM\Column(name="title", type="string", length=150, nullable=true)
61
     */
62
    protected $title;
63
64
    /**
65
     * @var string
66
     *
67
     * @ORM\Column(name="description", type="text", nullable=true)
68
     */
69
    protected $description;
70
71
    /**
72
     * @var int
73
     *
74
     * @ORM\Column(name="category_id", type="integer", nullable=true)
75
     */
76
    protected $categoryId;
77
78
    /**
79
     * @var int
80
     *
81
     * @ORM\Column(name="display_order", type="integer", nullable=false)
82
     */
83
    protected $displayOrder;
84
85
    /**
86
     * @var string
87
     *
88
     * @ORM\Column(name="on_homepage", type="string", length=10, nullable=false)
89
     */
90
    protected $onHomepage;
91
92
    /**
93
     * @var string
94
     *
95
     * @ORM\Column(name="target", type="string", length=10, nullable=true)
96
     */
97
    protected $target;
98
99
    /**
100
     * @var int
101
     *
102
     * @ORM\Column(name="session_id", type="integer", nullable=true)
103
     */
104
    protected $sessionId;
105
106
    public function __construct()
107
    {
108
        $this->displayOrder = 0;
109
    }
110
111
    public function __toString(): string
112
    {
113
        return $this->getTitle();
114
    }
115
116
    /**
117
     * Set url.
118
     *
119
     * @param string $url
120
     *
121
     * @return CLink
122
     */
123
    public function setUrl($url)
124
    {
125
        $this->url = $url;
126
127
        return $this;
128
    }
129
130
    /**
131
     * Get url.
132
     *
133
     * @return string
134
     */
135
    public function getUrl()
136
    {
137
        return $this->url;
138
    }
139
140
    /**
141
     * Set title.
142
     *
143
     * @param string $title
144
     *
145
     * @return CLink
146
     */
147
    public function setTitle($title)
148
    {
149
        $this->title = $title;
150
151
        return $this;
152
    }
153
154
    /**
155
     * Get title.
156
     *
157
     * @return string
158
     */
159
    public function getTitle()
160
    {
161
        return (string) $this->title;
162
    }
163
164
    /**
165
     * Set description.
166
     *
167
     * @param string $description
168
     *
169
     * @return CLink
170
     */
171
    public function setDescription($description)
172
    {
173
        $this->description = $description;
174
175
        return $this;
176
    }
177
178
    /**
179
     * Get description.
180
     *
181
     * @return string
182
     */
183
    public function getDescription()
184
    {
185
        return $this->description;
186
    }
187
188
    /**
189
     * Set categoryId.
190
     *
191
     * @param int $categoryId
192
     *
193
     * @return CLink
194
     */
195
    public function setCategoryId($categoryId)
196
    {
197
        $this->categoryId = $categoryId;
198
199
        return $this;
200
    }
201
202
    /**
203
     * Get categoryId.
204
     *
205
     * @return int
206
     */
207
    public function getCategoryId()
208
    {
209
        return $this->categoryId;
210
    }
211
212
    /**
213
     * Set displayOrder.
214
     *
215
     * @param int $displayOrder
216
     *
217
     * @return CLink
218
     */
219
    public function setDisplayOrder($displayOrder)
220
    {
221
        $this->displayOrder = $displayOrder;
222
223
        return $this;
224
    }
225
226
    /**
227
     * Get displayOrder.
228
     *
229
     * @return int
230
     */
231
    public function getDisplayOrder()
232
    {
233
        return $this->displayOrder;
234
    }
235
236
    /**
237
     * Set onHomepage.
238
     *
239
     * @param string $onHomepage
240
     *
241
     * @return CLink
242
     */
243
    public function setOnHomepage($onHomepage)
244
    {
245
        $this->onHomepage = $onHomepage;
246
247
        return $this;
248
    }
249
250
    /**
251
     * Get onHomepage.
252
     *
253
     * @return string
254
     */
255
    public function getOnHomepage()
256
    {
257
        return $this->onHomepage;
258
    }
259
260
    /**
261
     * Set target.
262
     *
263
     * @param string $target
264
     *
265
     * @return CLink
266
     */
267
    public function setTarget($target)
268
    {
269
        $this->target = $target;
270
271
        return $this;
272
    }
273
274
    /**
275
     * Get target.
276
     *
277
     * @return string
278
     */
279
    public function getTarget()
280
    {
281
        return $this->target;
282
    }
283
284
    /**
285
     * Set sessionId.
286
     *
287
     * @param int $sessionId
288
     *
289
     * @return CLink
290
     */
291
    public function setSessionId($sessionId)
292
    {
293
        $this->sessionId = $sessionId;
294
295
        return $this;
296
    }
297
298
    /**
299
     * Get sessionId.
300
     *
301
     * @return int
302
     */
303
    public function getSessionId()
304
    {
305
        return $this->sessionId;
306
    }
307
308
    /**
309
     * Set id.
310
     *
311
     * @param int $id
312
     *
313
     * @return CLink
314
     */
315
    public function setId($id)
316
    {
317
        $this->id = $id;
318
319
        return $this;
320
    }
321
322
    /**
323
     * Get id.
324
     *
325
     * @return int
326
     */
327
    public function getId()
328
    {
329
        return $this->id;
330
    }
331
332
    public function getIid(): int
333
    {
334
        return $this->iid;
335
    }
336
337
    public function setIid(int $iid): self
338
    {
339
        $this->iid = $iid;
340
341
        return $this;
342
    }
343
344
    /**
345
     * Set cId.
346
     *
347
     * @param int $cId
348
     *
349
     * @return CLink
350
     */
351
    public function setCId($cId)
352
    {
353
        $this->cId = $cId;
354
355
        return $this;
356
    }
357
358
    /**
359
     * Get cId.
360
     *
361
     * @return int
362
     */
363
    public function getCId()
364
    {
365
        return $this->cId;
366
    }
367
368
    /**
369
     * Resource identifier.
370
     */
371
    public function getResourceIdentifier(): int
372
    {
373
        return $this->iid;
374
    }
375
376
    public function getResourceName(): string
377
    {
378
        return $this->getTitle();
379
    }
380
}
381