Passed
Push — master ( c1edf4...121f34 )
by Julito
09:10
created

CGlossary::setGlossaryId()   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 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
 * CGlossary.
14
 *
15
 * @GRID\Source(columns="iid, name, description", filterable=false, groups={"resource"})
16
 * @ORM\Table(
17
 *  name="c_glossary",
18
 *  indexes={
19
 *      @ORM\Index(name="course", columns={"c_id"}),
20
 *      @ORM\Index(name="session_id", columns={"session_id"})
21
 *  }
22
 * )
23
 * @ORM\Entity
24
 */
25
class CGlossary 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 string
45
     *
46
     * @ORM\Column(name="name", type="text", nullable=false)
47
     */
48
    protected $name;
49
50
    /**
51
     * @var string
52
     *
53
     * @ORM\Column(name="description", type="text", nullable=false)
54
     */
55
    protected $description;
56
57
    /**
58
     * @var int
59
     *
60
     * @ORM\Column(name="display_order", type="integer", nullable=true)
61
     */
62
    protected $displayOrder;
63
64
    /**
65
     * @var int
66
     *
67
     * @ORM\Column(name="session_id", type="integer", nullable=true)
68
     */
69
    protected $sessionId;
70
71
    /**
72
     * Set name.
73
     *
74
     * @param string $name
75
     *
76
     * @return CGlossary
77
     */
78
    public function setName($name)
79
    {
80
        $this->name = $name;
81
82
        return $this;
83
    }
84
85
    /**
86
     * Get name.
87
     *
88
     * @return string
89
     */
90
    public function getName()
91
    {
92
        return (string) $this->name;
93
    }
94
95
    /**
96
     * Set description.
97
     *
98
     * @param string $description
99
     *
100
     * @return CGlossary
101
     */
102
    public function setDescription($description)
103
    {
104
        $this->description = $description;
105
106
        return $this;
107
    }
108
109
    /**
110
     * Get description.
111
     *
112
     * @return string
113
     */
114
    public function getDescription()
115
    {
116
        return $this->description;
117
    }
118
119
    /**
120
     * Set displayOrder.
121
     *
122
     * @param int $displayOrder
123
     *
124
     * @return CGlossary
125
     */
126
    public function setDisplayOrder($displayOrder)
127
    {
128
        $this->displayOrder = $displayOrder;
129
130
        return $this;
131
    }
132
133
    /**
134
     * Get displayOrder.
135
     *
136
     * @return int
137
     */
138
    public function getDisplayOrder()
139
    {
140
        return $this->displayOrder;
141
    }
142
143
    /**
144
     * Set sessionId.
145
     *
146
     * @param int $sessionId
147
     *
148
     * @return CGlossary
149
     */
150
    public function setSessionId($sessionId)
151
    {
152
        $this->sessionId = $sessionId;
153
154
        return $this;
155
    }
156
157
    /**
158
     * Get sessionId.
159
     *
160
     * @return int
161
     */
162
    public function getSessionId()
163
    {
164
        return $this->sessionId;
165
    }
166
167
    /**
168
     * Set glossaryId.
169
     *
170
     * @param int $glossaryId
171
     *
172
     * @return CGlossary
173
     */
174
    public function setGlossaryId($glossaryId)
175
    {
176
        $this->glossaryId = $glossaryId;
0 ignored issues
show
Bug Best Practice introduced by
The property glossaryId does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
177
178
        return $this;
179
    }
180
181
    /**
182
     * Get glossaryId.
183
     *
184
     * @return int
185
     */
186
    public function getGlossaryId()
187
    {
188
        return $this->glossaryId;
189
    }
190
191
    /**
192
     * Set cId.
193
     *
194
     * @param int $cId
195
     *
196
     * @return CGlossary
197
     */
198
    public function setCId($cId)
199
    {
200
        $this->cId = $cId;
201
202
        return $this;
203
    }
204
205
    /**
206
     * Get cId.
207
     *
208
     * @return int
209
     */
210
    public function getCId()
211
    {
212
        return $this->cId;
213
    }
214
215
    public function getIid(): int
216
    {
217
        return $this->iid;
218
    }
219
220
    public function __toString(): string
221
    {
222
        return $this->getName();
223
    }
224
225
    /**
226
     * Resource identifier.
227
     */
228
    public function getResourceIdentifier(): int
229
    {
230
        return $this->getIid();
231
    }
232
233
    public function getResourceName(): string
234
    {
235
        return $this->getName();
236
    }
237
}
238