Passed
Push — master ( 1cf373...d04f46 )
by Julito
09:24
created

GradebookLink::getVisible()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
namespace Chamilo\CoreBundle\Entity;
6
7
use Chamilo\CoreBundle\Traits\CourseTrait;
8
use Doctrine\ORM\Mapping as ORM;
9
use Gedmo\Mapping\Annotation as Gedmo;
10
11
/**
12
 * GradebookLink.
13
 *
14
 * @ORM\Table(name="gradebook_link",
15
 *  indexes={
16
 *     @ORM\Index(name="idx_gl_cat", columns={"category_id"}),
17
 *  }
18
 * )
19
 * @ORM\Entity
20
 */
21
class GradebookLink
22
{
23
    use CourseTrait;
24
25
    /**
26
     * @var int
27
     *
28
     * @ORM\Column(name="id", type="integer")
29
     * @ORM\Id
30
     * @ORM\GeneratedValue
31
     */
32
    protected $id;
33
34
    /**
35
     * @var int
36
     *
37
     * @ORM\Column(name="type", type="integer", nullable=false)
38
     */
39
    protected $type;
40
41
    /**
42
     * @var int
43
     *
44
     * @ORM\Column(name="ref_id", type="integer", nullable=false)
45
     */
46
    protected $refId;
47
48
    /**
49
     * @var int
50
     *
51
     * @ORM\Column(name="user_id", type="integer", nullable=false)
52
     */
53
    protected $userId;
54
55
    /**
56
     * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course", inversedBy="gradebookLinks")
57
     * @ORM\JoinColumn(name="c_id", referencedColumnName="id")
58
     */
59
    protected $course;
60
61
    /**
62
     * @var int
63
     *
64
     * @ORM\Column(name="category_id", type="integer", nullable=false)
65
     */
66
    protected $categoryId;
67
68
    /**
69
     * @var \DateTime
70
     *
71
     * @Gedmo\Timestampable(on="create")
72
     *
73
     * @ORM\Column(name="created_at", type="datetime", nullable=false)
74
     */
75
    protected $createdAt;
76
77
    /**
78
     * @var float
79
     *
80
     * @ORM\Column(name="weight", type="float", precision=10, scale=0, nullable=false)
81
     */
82
    protected $weight;
83
84
    /**
85
     * @var int
86
     *
87
     * @ORM\Column(name="visible", type="integer", nullable=false)
88
     */
89
    protected $visible;
90
91
    /**
92
     * @var int
93
     *
94
     * @ORM\Column(name="locked", type="integer", nullable=false)
95
     */
96
    protected $locked;
97
98
    /**
99
     * @var float
100
     *
101
     * @ORM\Column(name="best_score", type="float", precision=6, scale=2, nullable=true)
102
     */
103
    protected $bestScore;
104
105
    /**
106
     * @var float
107
     *
108
     * @ORM\Column(name="average_score", type="float", precision=6, scale=2, nullable=true)
109
     */
110
    protected $averageScore;
111
112
    /**
113
     * @var float
114
     *
115
     * @ORM\Column(name="score_weight", type="float", precision=6, scale=2, nullable=true)
116
     */
117
    protected $scoreWeight;
118
119
    /**
120
     * @var array
121
     *
122
     * @ORM\Column(name="user_score_list", type="array", nullable=true)
123
     */
124
    protected $userScoreList;
125
126
    /**
127
     * GradebookEvaluation constructor.
128
     */
129
    public function __construct()
130
    {
131
        $this->locked = 0;
132
    }
133
134
    /**
135
     * Set type.
136
     *
137
     * @param int $type
138
     *
139
     * @return GradebookLink
140
     */
141
    public function setType($type)
142
    {
143
        $this->type = $type;
144
145
        return $this;
146
    }
147
148
    /**
149
     * Get type.
150
     *
151
     * @return int
152
     */
153
    public function getType()
154
    {
155
        return $this->type;
156
    }
157
158
    /**
159
     * Set refId.
160
     *
161
     * @param int $refId
162
     *
163
     * @return GradebookLink
164
     */
165
    public function setRefId($refId)
166
    {
167
        $this->refId = $refId;
168
169
        return $this;
170
    }
171
172
    /**
173
     * Get refId.
174
     *
175
     * @return int
176
     */
177
    public function getRefId()
178
    {
179
        return $this->refId;
180
    }
181
182
    /**
183
     * Set userId.
184
     *
185
     * @param int $userId
186
     *
187
     * @return GradebookLink
188
     */
189
    public function setUserId($userId)
190
    {
191
        $this->userId = $userId;
192
193
        return $this;
194
    }
195
196
    /**
197
     * Get userId.
198
     *
199
     * @return int
200
     */
201
    public function getUserId()
202
    {
203
        return $this->userId;
204
    }
205
206
    /**
207
     * Set categoryId.
208
     *
209
     * @param int $categoryId
210
     *
211
     * @return GradebookLink
212
     */
213
    public function setCategoryId($categoryId)
214
    {
215
        $this->categoryId = $categoryId;
216
217
        return $this;
218
    }
219
220
    /**
221
     * Get categoryId.
222
     *
223
     * @return int
224
     */
225
    public function getCategoryId()
226
    {
227
        return $this->categoryId;
228
    }
229
230
    /**
231
     * Set createdAt.
232
     *
233
     * @param \DateTime $createdAt
234
     *
235
     * @return GradebookLink
236
     */
237
    public function setCreatedAt($createdAt)
238
    {
239
        $this->createdAt = $createdAt;
240
241
        return $this;
242
    }
243
244
    /**
245
     * Get createdAt.
246
     *
247
     * @return \DateTime
248
     */
249
    public function getCreatedAt()
250
    {
251
        return $this->createdAt;
252
    }
253
254
    /**
255
     * Set weight.
256
     *
257
     * @param float $weight
258
     *
259
     * @return GradebookLink
260
     */
261
    public function setWeight($weight)
262
    {
263
        $this->weight = $weight;
264
265
        return $this;
266
    }
267
268
    /**
269
     * Get weight.
270
     *
271
     * @return float
272
     */
273
    public function getWeight()
274
    {
275
        return $this->weight;
276
    }
277
278
    /**
279
     * Set visible.
280
     *
281
     * @param int $visible
282
     *
283
     * @return GradebookLink
284
     */
285
    public function setVisible($visible)
286
    {
287
        $this->visible = $visible;
288
289
        return $this;
290
    }
291
292
    /**
293
     * Get visible.
294
     *
295
     * @return int
296
     */
297
    public function getVisible()
298
    {
299
        return $this->visible;
300
    }
301
302
    /**
303
     * Set locked.
304
     *
305
     * @param int $locked
306
     *
307
     * @return GradebookLink
308
     */
309
    public function setLocked($locked)
310
    {
311
        $this->locked = $locked;
312
313
        return $this;
314
    }
315
316
    /**
317
     * Get locked.
318
     *
319
     * @return int
320
     */
321
    public function getLocked()
322
    {
323
        return $this->locked;
324
    }
325
326
    /**
327
     * Get id.
328
     *
329
     * @return int
330
     */
331
    public function getId()
332
    {
333
        return $this->id;
334
    }
335
336
    /**
337
     * @return float
338
     */
339
    public function getBestScore()
340
    {
341
        return $this->bestScore;
342
    }
343
344
    /**
345
     * @param float $bestScore
346
     *
347
     * @return GradebookLink
348
     */
349
    public function setBestScore($bestScore)
350
    {
351
        $this->bestScore = $bestScore;
352
353
        return $this;
354
    }
355
356
    /**
357
     * @return float
358
     */
359
    public function getAverageScore()
360
    {
361
        return $this->averageScore;
362
    }
363
364
    /**
365
     * @param float $averageScore
366
     *
367
     * @return GradebookLink
368
     */
369
    public function setAverageScore($averageScore)
370
    {
371
        $this->averageScore = $averageScore;
372
373
        return $this;
374
    }
375
376
    /**
377
     * @return array
378
     */
379
    public function getUserScoreList()
380
    {
381
        if (empty($this->userScoreList)) {
382
            return [];
383
        }
384
385
        return $this->userScoreList;
386
    }
387
388
    /**
389
     * @param array $userScoreList
390
     *
391
     * @return GradebookLink
392
     */
393
    public function setUserScoreList($userScoreList)
394
    {
395
        $this->userScoreList = $userScoreList;
396
397
        return $this;
398
    }
399
400
    /**
401
     * @return float
402
     */
403
    public function getScoreWeight()
404
    {
405
        return $this->scoreWeight;
406
    }
407
408
    /**
409
     * @param float $scoreWeight
410
     *
411
     * @return GradebookLink
412
     */
413
    public function setScoreWeight($scoreWeight)
414
    {
415
        $this->scoreWeight = $scoreWeight;
416
417
        return $this;
418
    }
419
}
420