Passed
Push — master ( 2d734c...ff47af )
by Julito
10:08
created

CForumCategory::setSessionId()   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
/* 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 Doctrine\Common\Collections\ArrayCollection;
10
use Doctrine\ORM\Mapping as ORM;
11
12
/**
13
 * CForumCategory.
14
 *
15
 * @ORM\Table(
16
 *  name="c_forum_category",
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 CForumCategory 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="c_id", type="integer")
39
     */
40
    protected $cId;
41
42
    /**
43
     * @var string
44
     *
45
     * @ORM\Column(name="cat_title", type="string", length=255, nullable=false)
46
     */
47
    protected $catTitle;
48
49
    /**
50
     * @var string
51
     *
52
     * @ORM\Column(name="cat_comment", type="text", nullable=true)
53
     */
54
    protected $catComment;
55
56
    /**
57
     * @var int
58
     *
59
     * @ORM\Column(name="cat_order", type="integer", nullable=false)
60
     */
61
    protected $catOrder;
62
63
    /**
64
     * @var int
65
     *
66
     * @ORM\Column(name="locked", type="integer", nullable=false)
67
     */
68
    protected $locked;
69
70
    /**
71
     * @var int
72
     *
73
     * @ORM\Column(name="session_id", type="integer", nullable=false)
74
     */
75
    protected $sessionId;
76
77
    /**
78
     * @var int
79
     *
80
     * @ORM\Column(name="cat_id", type="integer")
81
     */
82
    protected $catId;
83
84
    /**
85
     * @var CItemProperty
86
     */
87
    protected $itemProperty;
88
89
    /**
90
     * @var ArrayCollection
91
     *
92
     * @ORM\OneToMany(targetEntity="Chamilo\CourseBundle\Entity\CForumForum", mappedBy="forumCategory")
93
     */
94
    protected $forums;
95
96
    public function __construct()
97
    {
98
        $this->locked = 0;
99
100
        $this->catId = 0;
101
    }
102
103
    public function __toString(): string
104
    {
105
        return $this->getCatTitle();
106
    }
107
108
    /**
109
     * Get iid.
110
     *
111
     * @return int
112
     */
113
    public function getIid()
114
    {
115
        return $this->iid;
116
    }
117
118
    /**
119
     * Set catTitle.
120
     *
121
     * @param string $catTitle
122
     *
123
     * @return CForumCategory
124
     */
125
    public function setCatTitle($catTitle)
126
    {
127
        $this->catTitle = $catTitle;
128
129
        return $this;
130
    }
131
132
    /**
133
     * Get catTitle.
134
     *
135
     * @return string
136
     */
137
    public function getCatTitle()
138
    {
139
        return $this->catTitle;
140
    }
141
142
    /**
143
     * Set catComment.
144
     *
145
     * @param string $catComment
146
     *
147
     * @return CForumCategory
148
     */
149
    public function setCatComment($catComment)
150
    {
151
        $this->catComment = $catComment;
152
153
        return $this;
154
    }
155
156
    /**
157
     * Get catComment.
158
     *
159
     * @return string
160
     */
161
    public function getCatComment()
162
    {
163
        return $this->catComment;
164
    }
165
166
    /**
167
     * Set catOrder.
168
     *
169
     * @param int $catOrder
170
     *
171
     * @return CForumCategory
172
     */
173
    public function setCatOrder($catOrder)
174
    {
175
        $this->catOrder = $catOrder;
176
177
        return $this;
178
    }
179
180
    /**
181
     * Get catOrder.
182
     *
183
     * @return int
184
     */
185
    public function getCatOrder()
186
    {
187
        return $this->catOrder;
188
    }
189
190
    /**
191
     * Set locked.
192
     *
193
     * @param int $locked
194
     *
195
     * @return CForumCategory
196
     */
197
    public function setLocked($locked)
198
    {
199
        $this->locked = $locked;
200
201
        return $this;
202
    }
203
204
    /**
205
     * Get locked.
206
     *
207
     * @return int
208
     */
209
    public function getLocked()
210
    {
211
        return $this->locked;
212
    }
213
214
    /**
215
     * Set sessionId.
216
     *
217
     * @param int $sessionId
218
     *
219
     * @return CForumCategory
220
     */
221
    public function setSessionId($sessionId)
222
    {
223
        $this->sessionId = $sessionId;
224
225
        return $this;
226
    }
227
228
    /**
229
     * Get sessionId.
230
     *
231
     * @return int
232
     */
233
    public function getSessionId()
234
    {
235
        return $this->sessionId;
236
    }
237
238
    /**
239
     * Set catId.
240
     *
241
     * @param int $catId
242
     *
243
     * @return CForumCategory
244
     */
245
    public function setCatId($catId)
246
    {
247
        $this->catId = $catId;
248
249
        return $this;
250
    }
251
252
    /**
253
     * Get catId.
254
     *
255
     * @return int
256
     */
257
    public function getCatId()
258
    {
259
        return $this->catId;
260
    }
261
262
    /**
263
     * Set cId.
264
     *
265
     * @param int $cId
266
     *
267
     * @return CForumCategory
268
     */
269
    public function setCId($cId)
270
    {
271
        $this->cId = $cId;
272
273
        return $this;
274
    }
275
276
    /**
277
     * Get cId.
278
     *
279
     * @return int
280
     */
281
    public function getCId()
282
    {
283
        return $this->cId;
284
    }
285
286
    /**
287
     * Get forums.
288
     *
289
     * @return ArrayCollection|CForumForum[]
290
     */
291
    public function getForums()
292
    {
293
        return $this->forums;
294
    }
295
296
    /**
297
     * @return CForumCategory
298
     */
299
    public function setItemProperty(CItemProperty $itemProperty)
300
    {
301
        $this->itemProperty = $itemProperty;
302
303
        return $this;
304
    }
305
306
    /**
307
     * @return CItemProperty
308
     */
309
    public function getItemProperty()
310
    {
311
        return $this->itemProperty;
312
    }
313
314
    /**
315
     * Resource identifier.
316
     */
317
    public function getResourceIdentifier(): int
318
    {
319
        return $this->getIid();
320
    }
321
322
    public function getResourceName(): string
323
    {
324
        return $this->getCatTitle();
325
    }
326
}
327