Passed
Push — master ( d5e463...fe6195 )
by Julito
09:53
created

CCourseDescription::setProgress()   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
 * CCourseDescription.
14
 *
15
 * @GRID\Source(columns="iid, title, resourceNode.createdAt", filterable=false, groups={"resource"})
16
 *
17
 * @ORM\Table(name="c_course_description", indexes={@ORM\Index(name="session_id", columns={"session_id"})})
18
 * @ORM\Entity
19
 */
20
class CCourseDescription extends AbstractResource implements ResourceInterface
21
{
22
    public const TYPE_DESCRIPTION = 1;
23
    public const TYPE_OBJECTIVES = 2;
24
    public const TYPE_TOPICS = 3;
25
    public const TYPE_METHODOLOGY = 4;
26
    public const TYPE_COURSE_MATERIAL = 5;
27
    public const TYPE_RESOURCES = 6;
28
    public const TYPE_ASSESSMENT = 7;
29
    public const TYPE_CUSTOM = 8;
30
31
    /**
32
     * @var int
33
     *
34
     * @ORM\Column(name="iid", type="integer")
35
     * @ORM\Id
36
     * @ORM\GeneratedValue
37
     */
38
    protected $iid;
39
40
    /**
41
     * @var int
42
     *
43
     * @ORM\Column(name="id", type="integer", nullable=true)
44
     */
45
    protected $id;
46
47
    /**
48
     * @var int
49
     *
50
     * @ORM\Column(name="c_id", type="integer")
51
     */
52
    protected $cId;
53
54
    /**
55
     * @var string
56
     *
57
     * @ORM\Column(name="title", type="text", nullable=true)
58
     */
59
    protected $title;
60
61
    /**
62
     * @var string
63
     *
64
     * @ORM\Column(name="content", type="text", nullable=true)
65
     */
66
    protected $content;
67
68
    /**
69
     * @var int
70
     *
71
     * @ORM\Column(name="session_id", type="integer", nullable=true)
72
     */
73
    protected $sessionId;
74
75
    /**
76
     * @var int
77
     *
78
     * @ORM\Column(name="description_type", type="integer", nullable=false)
79
     */
80
    protected $descriptionType;
81
82
    /**
83
     * @var int
84
     *
85
     * @ORM\Column(name="progress", type="integer", nullable=false)
86
     */
87
    protected $progress;
88
89
    /**
90
     * CCourseDescription constructor.
91
     *
92
     * @param int $iid
93
     */
94
    public function __construct()
95
    {
96
        $this->progress = 0;
97
        $this->descriptionType = 1;
98
    }
99
100
    /**
101
     * Set title.
102
     *
103
     * @param string $title
104
     *
105
     * @return CCourseDescription
106
     */
107
    public function setTitle($title)
108
    {
109
        $this->title = $title;
110
111
        return $this;
112
    }
113
114
    /**
115
     * Get title.
116
     *
117
     * @return string
118
     */
119
    public function getTitle()
120
    {
121
        return $this->title;
122
    }
123
124
    /**
125
     * Set content.
126
     *
127
     * @param string $content
128
     *
129
     * @return CCourseDescription
130
     */
131
    public function setContent($content)
132
    {
133
        $this->content = $content;
134
135
        return $this;
136
    }
137
138
    /**
139
     * Get content.
140
     *
141
     * @return string
142
     */
143
    public function getContent()
144
    {
145
        return $this->content;
146
    }
147
148
    /**
149
     * Set sessionId.
150
     *
151
     * @param int $sessionId
152
     *
153
     * @return CCourseDescription
154
     */
155
    public function setSessionId($sessionId)
156
    {
157
        $this->sessionId = $sessionId;
158
159
        return $this;
160
    }
161
162
    /**
163
     * Get sessionId.
164
     *
165
     * @return int
166
     */
167
    public function getSessionId()
168
    {
169
        return $this->sessionId;
170
    }
171
172
    /**
173
     * Set descriptionType.
174
     *
175
     * @param int $descriptionType
176
     *
177
     * @return CCourseDescription
178
     */
179
    public function setDescriptionType($descriptionType)
180
    {
181
        $this->descriptionType = $descriptionType;
182
183
        return $this;
184
    }
185
186
    /**
187
     * Get descriptionType.
188
     *
189
     * @return int
190
     */
191
    public function getDescriptionType()
192
    {
193
        return $this->descriptionType;
194
    }
195
196
    /**
197
     * Set progress.
198
     *
199
     * @param int $progress
200
     *
201
     * @return CCourseDescription
202
     */
203
    public function setProgress($progress)
204
    {
205
        $this->progress = $progress;
206
207
        return $this;
208
    }
209
210
    /**
211
     * Get progress.
212
     *
213
     * @return int
214
     */
215
    public function getProgress()
216
    {
217
        return $this->progress;
218
    }
219
220
    /**
221
     * Set id.
222
     *
223
     * @param int $id
224
     *
225
     * @return CCourseDescription
226
     */
227
    public function setId($id)
228
    {
229
        $this->id = $id;
230
231
        return $this;
232
    }
233
234
    /**
235
     * Get id.
236
     *
237
     * @return int
238
     */
239
    public function getId()
240
    {
241
        return $this->id;
242
    }
243
244
    /**
245
     * Set cId.
246
     *
247
     * @param int $cId
248
     *
249
     * @return CCourseDescription
250
     */
251
    public function setCId($cId)
252
    {
253
        $this->cId = $cId;
254
255
        return $this;
256
    }
257
258
    /**
259
     * Get cId.
260
     *
261
     * @return int
262
     */
263
    public function getCId()
264
    {
265
        return $this->cId;
266
    }
267
268
    /**
269
     * @return int
270
     */
271
    public function getIid()
272
    {
273
        return $this->iid;
274
    }
275
276
    public function __toString(): string
277
    {
278
        return $this->getTitle();
279
    }
280
281
    /**
282
     * Resource identifier.
283
     */
284
    public function getResourceIdentifier(): int
285
    {
286
        return $this->getIid();
287
    }
288
289
    public function getResourceName(): string
290
    {
291
        return $this->getTitle();
292
    }
293
}
294