Completed
Push — master ( c9546d...95f607 )
by Julito
09:41
created

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