Passed
Push — master ( 6f5f89...ff7940 )
by Julito
10:55
created

CForumCategory::setItemProperty()   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 ArrayCollection
86
     *
87
     * @ORM\OneToMany(targetEntity="Chamilo\CourseBundle\Entity\CForumForum", mappedBy="forumCategory")
88
     */
89
    protected $forums;
90
91
    public function __construct()
92
    {
93
        $this->locked = 0;
94
95
        $this->catId = 0;
96
    }
97
98
    public function __toString(): string
99
    {
100
        return $this->getCatTitle();
101
    }
102
103
    /**
104
     * Get iid.
105
     *
106
     * @return int
107
     */
108
    public function getIid()
109
    {
110
        return $this->iid;
111
    }
112
113
    /**
114
     * Set catTitle.
115
     *
116
     * @param string $catTitle
117
     *
118
     * @return CForumCategory
119
     */
120
    public function setCatTitle($catTitle)
121
    {
122
        $this->catTitle = $catTitle;
123
124
        return $this;
125
    }
126
127
    /**
128
     * Get catTitle.
129
     *
130
     * @return string
131
     */
132
    public function getCatTitle()
133
    {
134
        return $this->catTitle;
135
    }
136
137
    /**
138
     * Set catComment.
139
     *
140
     * @param string $catComment
141
     *
142
     * @return CForumCategory
143
     */
144
    public function setCatComment($catComment)
145
    {
146
        $this->catComment = $catComment;
147
148
        return $this;
149
    }
150
151
    /**
152
     * Get catComment.
153
     *
154
     * @return string
155
     */
156
    public function getCatComment()
157
    {
158
        return $this->catComment;
159
    }
160
161
    /**
162
     * Set catOrder.
163
     *
164
     * @param int $catOrder
165
     *
166
     * @return CForumCategory
167
     */
168
    public function setCatOrder($catOrder)
169
    {
170
        $this->catOrder = $catOrder;
171
172
        return $this;
173
    }
174
175
    /**
176
     * Get catOrder.
177
     *
178
     * @return int
179
     */
180
    public function getCatOrder()
181
    {
182
        return $this->catOrder;
183
    }
184
185
    /**
186
     * Set locked.
187
     *
188
     * @param int $locked
189
     *
190
     * @return CForumCategory
191
     */
192
    public function setLocked($locked)
193
    {
194
        $this->locked = $locked;
195
196
        return $this;
197
    }
198
199
    /**
200
     * Get locked.
201
     *
202
     * @return int
203
     */
204
    public function getLocked()
205
    {
206
        return $this->locked;
207
    }
208
209
    /**
210
     * Set sessionId.
211
     *
212
     * @param int $sessionId
213
     *
214
     * @return CForumCategory
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 (int) $this->sessionId;
231
    }
232
233
    /**
234
     * Set catId.
235
     *
236
     * @param int $catId
237
     *
238
     * @return CForumCategory
239
     */
240
    public function setCatId($catId)
241
    {
242
        $this->catId = $catId;
243
244
        return $this;
245
    }
246
247
    /**
248
     * Get catId.
249
     *
250
     * @return int
251
     */
252
    public function getCatId()
253
    {
254
        return $this->catId;
255
    }
256
257
    /**
258
     * Set cId.
259
     *
260
     * @param int $cId
261
     *
262
     * @return CForumCategory
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 forums.
283
     *
284
     * @return ArrayCollection|CForumForum[]
285
     */
286
    public function getForums()
287
    {
288
        return $this->forums;
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->getCatTitle();
302
    }
303
}
304