Completed
Push — master ( db9c88...be5baf )
by Julito
14:58
created

CGlossary   A

Complexity

Total Complexity 17

Size/Duplication

Total Lines 216
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 30
c 0
b 0
f 0
dl 0
loc 216
rs 10
wmc 17

17 Methods

Rating   Name   Duplication   Size   Complexity  
A setCId() 0 5 1
A getName() 0 3 1
A getSessionId() 0 3 1
A getResourceName() 0 3 1
A getCId() 0 3 1
A setGlossaryId() 0 5 1
A getDescription() 0 3 1
A setSessionId() 0 5 1
A getGlossaryId() 0 3 1
A getDisplayOrder() 0 3 1
A getIid() 0 3 1
A __toString() 0 3 1
A setName() 0 5 1
A setDescription() 0 5 1
A getResourceIdentifier() 0 3 1
A setDisplayOrder() 0 5 1
A setResourceName() 0 3 1
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 Symfony\Component\Validator\Constraints as Assert;
11
12
/**
13
 * CGlossary.
14
 *
15
 * @ORM\Table(
16
 *  name="c_glossary",
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 CGlossary 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
     * @Assert\NotBlank()
45
     * @ORM\Column(name="name", type="text", nullable=false)
46
     */
47
    protected $name;
48
49
    /**
50
     * @var string
51
     *
52
     * @ORM\Column(name="description", type="text", nullable=false)
53
     */
54
    protected $description;
55
56
    /**
57
     * @var int
58
     *
59
     * @ORM\Column(name="display_order", type="integer", nullable=true)
60
     */
61
    protected $displayOrder;
62
63
    /**
64
     * @var int
65
     *
66
     * @ORM\Column(name="session_id", type="integer", nullable=true)
67
     */
68
    protected $sessionId;
69
70
    public function __toString(): string
71
    {
72
        return $this->getName();
73
    }
74
75
    /**
76
     * Set name.
77
     *
78
     * @param string $name
79
     *
80
     * @return CGlossary
81
     */
82
    public function setName($name)
83
    {
84
        $this->name = $name;
85
86
        return $this;
87
    }
88
89
    /**
90
     * Get name.
91
     *
92
     * @return string
93
     */
94
    public function getName()
95
    {
96
        return (string) $this->name;
97
    }
98
99
    /**
100
     * Set description.
101
     *
102
     * @param string $description
103
     *
104
     * @return CGlossary
105
     */
106
    public function setDescription($description)
107
    {
108
        $this->description = $description;
109
110
        return $this;
111
    }
112
113
    /**
114
     * Get description.
115
     *
116
     * @return string
117
     */
118
    public function getDescription()
119
    {
120
        return $this->description;
121
    }
122
123
    /**
124
     * Set displayOrder.
125
     *
126
     * @param int $displayOrder
127
     *
128
     * @return CGlossary
129
     */
130
    public function setDisplayOrder($displayOrder)
131
    {
132
        $this->displayOrder = $displayOrder;
133
134
        return $this;
135
    }
136
137
    /**
138
     * Get displayOrder.
139
     *
140
     * @return int
141
     */
142
    public function getDisplayOrder()
143
    {
144
        return $this->displayOrder;
145
    }
146
147
    /**
148
     * Set sessionId.
149
     *
150
     * @param int $sessionId
151
     *
152
     * @return CGlossary
153
     */
154
    public function setSessionId($sessionId)
155
    {
156
        $this->sessionId = $sessionId;
157
158
        return $this;
159
    }
160
161
    /**
162
     * Get sessionId.
163
     *
164
     * @return int
165
     */
166
    public function getSessionId()
167
    {
168
        return $this->sessionId;
169
    }
170
171
    /**
172
     * Set glossaryId.
173
     *
174
     * @param int $glossaryId
175
     *
176
     * @return CGlossary
177
     */
178
    public function setGlossaryId($glossaryId)
179
    {
180
        $this->glossaryId = $glossaryId;
181
182
        return $this;
183
    }
184
185
    /**
186
     * Get glossaryId.
187
     *
188
     * @return int
189
     */
190
    public function getGlossaryId()
191
    {
192
        return $this->glossaryId;
193
    }
194
195
    /**
196
     * Set cId.
197
     *
198
     * @param int $cId
199
     *
200
     * @return CGlossary
201
     */
202
    public function setCId($cId)
203
    {
204
        $this->cId = $cId;
205
206
        return $this;
207
    }
208
209
    /**
210
     * Get cId.
211
     *
212
     * @return int
213
     */
214
    public function getCId()
215
    {
216
        return $this->cId;
217
    }
218
219
    public function getIid(): int
220
    {
221
        return $this->iid;
222
    }
223
224
    /**
225
     * Resource identifier.
226
     */
227
    public function getResourceIdentifier(): int
228
    {
229
        return $this->getIid();
230
    }
231
232
    public function getResourceName(): string
233
    {
234
        return $this->getName();
235
    }
236
237
    public function setResourceName(string $name): self
238
    {
239
        return $this->setName($name);
240
    }
241
}
242