1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* For licensing terms, see /license.txt */ |
4
|
|
|
|
5
|
|
|
namespace Chamilo\CoreBundle\Entity; |
6
|
|
|
|
7
|
|
|
use Chamilo\CoreBundle\Traits\UserTrait; |
8
|
|
|
use Doctrine\ORM\Mapping as ORM; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* GradebookCategory. |
12
|
|
|
* |
13
|
|
|
* @ORM\Table(name="gradebook_category", |
14
|
|
|
* indexes={ |
15
|
|
|
* @ORM\Index(name="idx_gb_cat_parent", columns={"parent_id"}), |
16
|
|
|
* })) |
17
|
|
|
* @ORM\Entity |
18
|
|
|
*/ |
19
|
|
|
class GradebookCategory |
20
|
|
|
{ |
21
|
|
|
use UserTrait; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @var int |
25
|
|
|
* |
26
|
|
|
* @ORM\Column(name="id", type="integer") |
27
|
|
|
* @ORM\Id |
28
|
|
|
* @ORM\GeneratedValue |
29
|
|
|
*/ |
30
|
|
|
protected $id; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @var string |
34
|
|
|
* |
35
|
|
|
* @ORM\Column(name="name", type="text", nullable=false) |
36
|
|
|
*/ |
37
|
|
|
protected $name; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @var string |
41
|
|
|
* |
42
|
|
|
* @ORM\Column(name="description", type="text", nullable=true) |
43
|
|
|
*/ |
44
|
|
|
protected $description; |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @var User |
48
|
|
|
* |
49
|
|
|
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User", inversedBy="gradeBookCategories") |
50
|
|
|
* @ORM\JoinColumn(name="user_id", referencedColumnName="id") |
51
|
|
|
*/ |
52
|
|
|
protected $user; |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course", inversedBy="gradebookCategories") |
56
|
|
|
* @ORM\JoinColumn(name="c_id", referencedColumnName="id") |
57
|
|
|
*/ |
58
|
|
|
protected $course; |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @var int |
62
|
|
|
* |
63
|
|
|
* @ORM\Column(name="parent_id", type="integer", nullable=true) |
64
|
|
|
*/ |
65
|
|
|
protected $parentId; |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* @var float |
69
|
|
|
* |
70
|
|
|
* @ORM\Column(name="weight", type="float", precision=10, scale=0, nullable=false) |
71
|
|
|
*/ |
72
|
|
|
protected $weight; |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @var bool |
76
|
|
|
* |
77
|
|
|
* @ORM\Column(name="visible", type="boolean", nullable=false) |
78
|
|
|
*/ |
79
|
|
|
protected $visible; |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* @var int |
83
|
|
|
* |
84
|
|
|
* @ORM\Column(name="certif_min_score", type="integer", nullable=true) |
85
|
|
|
*/ |
86
|
|
|
protected $certifMinScore; |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* @var int |
90
|
|
|
* |
91
|
|
|
* @ORM\Column(name="session_id", type="integer", nullable=true) |
92
|
|
|
*/ |
93
|
|
|
protected $sessionId; |
94
|
|
|
|
95
|
|
|
/** |
96
|
|
|
* @var int |
97
|
|
|
* |
98
|
|
|
* @ORM\Column(name="document_id", type="integer", nullable=true) |
99
|
|
|
*/ |
100
|
|
|
protected $documentId; |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @var int |
104
|
|
|
* |
105
|
|
|
* @ORM\Column(name="locked", type="integer", nullable=false) |
106
|
|
|
*/ |
107
|
|
|
protected $locked; |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* @var bool |
111
|
|
|
* |
112
|
|
|
* @ORM\Column(name="default_lowest_eval_exclude", type="boolean", nullable=true) |
113
|
|
|
*/ |
114
|
|
|
protected $defaultLowestEvalExclude; |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* @var bool |
118
|
|
|
* |
119
|
|
|
* @ORM\Column(name="generate_certificates", type="boolean", nullable=false) |
120
|
|
|
*/ |
121
|
|
|
protected $generateCertificates; |
122
|
|
|
|
123
|
|
|
/** |
124
|
|
|
* @var int |
125
|
|
|
* |
126
|
|
|
* @ORM\Column(name="grade_model_id", type="integer", nullable=true) |
127
|
|
|
*/ |
128
|
|
|
protected $gradeModelId; |
129
|
|
|
|
130
|
|
|
/** |
131
|
|
|
* @var bool |
132
|
|
|
* |
133
|
|
|
* @ORM\Column( |
134
|
|
|
* name="is_requirement", |
135
|
|
|
* type="boolean", |
136
|
|
|
* nullable=false, |
137
|
|
|
* options={"default": 0 } |
138
|
|
|
* ) |
139
|
|
|
*/ |
140
|
|
|
protected $isRequirement; |
141
|
|
|
|
142
|
|
|
/** |
143
|
|
|
* @var string |
144
|
|
|
* |
145
|
|
|
* @ORM\Column(name="depends", type="text", nullable=true) |
146
|
|
|
*/ |
147
|
|
|
protected $depends; |
148
|
|
|
|
149
|
|
|
/** |
150
|
|
|
* @var int |
151
|
|
|
* |
152
|
|
|
* @ORM\Column(name="minimum_to_validate", type="integer", nullable=true) |
153
|
|
|
*/ |
154
|
|
|
protected $minimumToValidate; |
155
|
|
|
|
156
|
|
|
/** |
157
|
|
|
* @var int |
158
|
|
|
* |
159
|
|
|
* @ORM\Column(name="gradebooks_to_validate_in_dependence", type="integer", nullable=true) |
160
|
|
|
*/ |
161
|
|
|
protected $gradeBooksToValidateInDependence; |
162
|
|
|
|
163
|
|
|
/** |
164
|
|
|
* GradebookCategory constructor. |
165
|
|
|
*/ |
166
|
|
|
public function __construct() |
167
|
|
|
{ |
168
|
|
|
$this->locked = 0; |
169
|
|
|
$this->generateCertificates = false; |
170
|
|
|
$this->isRequirement = false; |
171
|
|
|
} |
172
|
|
|
|
173
|
|
|
/** |
174
|
|
|
* Get id. |
175
|
|
|
* |
176
|
|
|
* @return int |
177
|
|
|
*/ |
178
|
|
|
public function getId() |
179
|
|
|
{ |
180
|
|
|
return $this->id; |
181
|
|
|
} |
182
|
|
|
|
183
|
|
|
/** |
184
|
|
|
* Set name. |
185
|
|
|
* |
186
|
|
|
* @param string $name |
187
|
|
|
* |
188
|
|
|
* @return GradebookCategory |
189
|
|
|
*/ |
190
|
|
|
public function setName($name) |
191
|
|
|
{ |
192
|
|
|
$this->name = $name; |
193
|
|
|
|
194
|
|
|
return $this; |
195
|
|
|
} |
196
|
|
|
|
197
|
|
|
/** |
198
|
|
|
* Get name. |
199
|
|
|
* |
200
|
|
|
* @return string |
201
|
|
|
*/ |
202
|
|
|
public function getName() |
203
|
|
|
{ |
204
|
|
|
return $this->name; |
205
|
|
|
} |
206
|
|
|
|
207
|
|
|
/** |
208
|
|
|
* Set description. |
209
|
|
|
* |
210
|
|
|
* @param string $description |
211
|
|
|
* |
212
|
|
|
* @return GradebookCategory |
213
|
|
|
*/ |
214
|
|
|
public function setDescription($description) |
215
|
|
|
{ |
216
|
|
|
$this->description = $description; |
217
|
|
|
|
218
|
|
|
return $this; |
219
|
|
|
} |
220
|
|
|
|
221
|
|
|
/** |
222
|
|
|
* Get description. |
223
|
|
|
* |
224
|
|
|
* @return string |
225
|
|
|
*/ |
226
|
|
|
public function getDescription() |
227
|
|
|
{ |
228
|
|
|
return $this->description; |
229
|
|
|
} |
230
|
|
|
|
231
|
|
|
/** |
232
|
|
|
* Set course. |
233
|
|
|
* |
234
|
|
|
* @param \Chamilo\CoreBundle\Entity\Course $course |
235
|
|
|
* |
236
|
|
|
* @return \Chamilo\CoreBundle\Entity\GradebookCategory |
237
|
|
|
*/ |
238
|
|
|
public function setCourse(Course $course) |
239
|
|
|
{ |
240
|
|
|
$this->course = $course; |
241
|
|
|
|
242
|
|
|
return $this; |
243
|
|
|
} |
244
|
|
|
|
245
|
|
|
/** |
246
|
|
|
* Get course. |
247
|
|
|
* |
248
|
|
|
* @return \Chamilo\CoreBundle\Entity\Course |
249
|
|
|
*/ |
250
|
|
|
public function getCourse() |
251
|
|
|
{ |
252
|
|
|
return $this->course; |
253
|
|
|
} |
254
|
|
|
|
255
|
|
|
/** |
256
|
|
|
* Set parentId. |
257
|
|
|
* |
258
|
|
|
* @param int $parentId |
259
|
|
|
* |
260
|
|
|
* @return GradebookCategory |
261
|
|
|
*/ |
262
|
|
|
public function setParentId($parentId) |
263
|
|
|
{ |
264
|
|
|
$this->parentId = $parentId; |
265
|
|
|
|
266
|
|
|
return $this; |
267
|
|
|
} |
268
|
|
|
|
269
|
|
|
/** |
270
|
|
|
* Get parentId. |
271
|
|
|
* |
272
|
|
|
* @return int |
273
|
|
|
*/ |
274
|
|
|
public function getParentId() |
275
|
|
|
{ |
276
|
|
|
return $this->parentId; |
277
|
|
|
} |
278
|
|
|
|
279
|
|
|
/** |
280
|
|
|
* Set weight. |
281
|
|
|
* |
282
|
|
|
* @param float $weight |
283
|
|
|
*/ |
284
|
|
|
public function setWeight($weight): self |
285
|
|
|
{ |
286
|
|
|
$this->weight = (float) $weight; |
287
|
|
|
|
288
|
|
|
return $this; |
289
|
|
|
} |
290
|
|
|
|
291
|
|
|
/** |
292
|
|
|
* Get weight. |
293
|
|
|
* |
294
|
|
|
* @return float |
295
|
|
|
*/ |
296
|
|
|
public function getWeight() |
297
|
|
|
{ |
298
|
|
|
return $this->weight; |
299
|
|
|
} |
300
|
|
|
|
301
|
|
|
/** |
302
|
|
|
* Set visible. |
303
|
|
|
* |
304
|
|
|
* @param bool $visible |
305
|
|
|
* |
306
|
|
|
* @return GradebookCategory |
307
|
|
|
*/ |
308
|
|
|
public function setVisible($visible) |
309
|
|
|
{ |
310
|
|
|
$this->visible = $visible; |
311
|
|
|
|
312
|
|
|
return $this; |
313
|
|
|
} |
314
|
|
|
|
315
|
|
|
/** |
316
|
|
|
* Get visible. |
317
|
|
|
* |
318
|
|
|
* @return bool |
319
|
|
|
*/ |
320
|
|
|
public function getVisible() |
321
|
|
|
{ |
322
|
|
|
return $this->visible; |
323
|
|
|
} |
324
|
|
|
|
325
|
|
|
/** |
326
|
|
|
* Set certifMinScore. |
327
|
|
|
* |
328
|
|
|
* @param int $certifMinScore |
329
|
|
|
* |
330
|
|
|
* @return GradebookCategory |
331
|
|
|
*/ |
332
|
|
|
public function setCertifMinScore($certifMinScore) |
333
|
|
|
{ |
334
|
|
|
$this->certifMinScore = $certifMinScore; |
335
|
|
|
|
336
|
|
|
return $this; |
337
|
|
|
} |
338
|
|
|
|
339
|
|
|
/** |
340
|
|
|
* Get certifMinScore. |
341
|
|
|
* |
342
|
|
|
* @return int |
343
|
|
|
*/ |
344
|
|
|
public function getCertifMinScore() |
345
|
|
|
{ |
346
|
|
|
return $this->certifMinScore; |
347
|
|
|
} |
348
|
|
|
|
349
|
|
|
/** |
350
|
|
|
* Set sessionId. |
351
|
|
|
* |
352
|
|
|
* @param int $sessionId |
353
|
|
|
* |
354
|
|
|
* @return GradebookCategory |
355
|
|
|
*/ |
356
|
|
|
public function setSessionId($sessionId) |
357
|
|
|
{ |
358
|
|
|
$this->sessionId = $sessionId; |
359
|
|
|
|
360
|
|
|
return $this; |
361
|
|
|
} |
362
|
|
|
|
363
|
|
|
/** |
364
|
|
|
* Get sessionId. |
365
|
|
|
* |
366
|
|
|
* @return int |
367
|
|
|
*/ |
368
|
|
|
public function getSessionId() |
369
|
|
|
{ |
370
|
|
|
return $this->sessionId; |
371
|
|
|
} |
372
|
|
|
|
373
|
|
|
/** |
374
|
|
|
* Set documentId. |
375
|
|
|
* |
376
|
|
|
* @param int $documentId |
377
|
|
|
* |
378
|
|
|
* @return GradebookCategory |
379
|
|
|
*/ |
380
|
|
|
public function setDocumentId($documentId) |
381
|
|
|
{ |
382
|
|
|
$this->documentId = $documentId; |
383
|
|
|
|
384
|
|
|
return $this; |
385
|
|
|
} |
386
|
|
|
|
387
|
|
|
/** |
388
|
|
|
* Get documentId. |
389
|
|
|
* |
390
|
|
|
* @return int |
391
|
|
|
*/ |
392
|
|
|
public function getDocumentId() |
393
|
|
|
{ |
394
|
|
|
return $this->documentId; |
395
|
|
|
} |
396
|
|
|
|
397
|
|
|
/** |
398
|
|
|
* Set locked. |
399
|
|
|
* |
400
|
|
|
* @param int $locked |
401
|
|
|
* |
402
|
|
|
* @return GradebookCategory |
403
|
|
|
*/ |
404
|
|
|
public function setLocked($locked) |
405
|
|
|
{ |
406
|
|
|
$this->locked = $locked; |
407
|
|
|
|
408
|
|
|
return $this; |
409
|
|
|
} |
410
|
|
|
|
411
|
|
|
/** |
412
|
|
|
* Get locked. |
413
|
|
|
* |
414
|
|
|
* @return int |
415
|
|
|
*/ |
416
|
|
|
public function getLocked() |
417
|
|
|
{ |
418
|
|
|
return $this->locked; |
419
|
|
|
} |
420
|
|
|
|
421
|
|
|
/** |
422
|
|
|
* Set defaultLowestEvalExclude. |
423
|
|
|
* |
424
|
|
|
* @param bool $defaultLowestEvalExclude |
425
|
|
|
* |
426
|
|
|
* @return GradebookCategory |
427
|
|
|
*/ |
428
|
|
|
public function setDefaultLowestEvalExclude($defaultLowestEvalExclude) |
429
|
|
|
{ |
430
|
|
|
$this->defaultLowestEvalExclude = $defaultLowestEvalExclude; |
431
|
|
|
|
432
|
|
|
return $this; |
433
|
|
|
} |
434
|
|
|
|
435
|
|
|
/** |
436
|
|
|
* Get defaultLowestEvalExclude. |
437
|
|
|
* |
438
|
|
|
* @return bool |
439
|
|
|
*/ |
440
|
|
|
public function getDefaultLowestEvalExclude() |
441
|
|
|
{ |
442
|
|
|
return $this->defaultLowestEvalExclude; |
443
|
|
|
} |
444
|
|
|
|
445
|
|
|
/** |
446
|
|
|
* Set generateCertificates. |
447
|
|
|
* |
448
|
|
|
* @param bool $generateCertificates |
449
|
|
|
* |
450
|
|
|
* @return GradebookCategory |
451
|
|
|
*/ |
452
|
|
|
public function setGenerateCertificates($generateCertificates) |
453
|
|
|
{ |
454
|
|
|
$this->generateCertificates = $generateCertificates; |
455
|
|
|
|
456
|
|
|
return $this; |
457
|
|
|
} |
458
|
|
|
|
459
|
|
|
/** |
460
|
|
|
* Get generateCertificates. |
461
|
|
|
* |
462
|
|
|
* @return bool |
463
|
|
|
*/ |
464
|
|
|
public function getGenerateCertificates() |
465
|
|
|
{ |
466
|
|
|
return $this->generateCertificates; |
467
|
|
|
} |
468
|
|
|
|
469
|
|
|
/** |
470
|
|
|
* Set gradeModelId. |
471
|
|
|
* |
472
|
|
|
* @param int $gradeModelId |
473
|
|
|
* |
474
|
|
|
* @return GradebookCategory |
475
|
|
|
*/ |
476
|
|
|
public function setGradeModelId($gradeModelId) |
477
|
|
|
{ |
478
|
|
|
$this->gradeModelId = $gradeModelId; |
479
|
|
|
|
480
|
|
|
return $this; |
481
|
|
|
} |
482
|
|
|
|
483
|
|
|
/** |
484
|
|
|
* Get gradeModelId. |
485
|
|
|
* |
486
|
|
|
* @return int |
487
|
|
|
*/ |
488
|
|
|
public function getGradeModelId() |
489
|
|
|
{ |
490
|
|
|
return $this->gradeModelId; |
491
|
|
|
} |
492
|
|
|
|
493
|
|
|
/** |
494
|
|
|
* Set isRequirement. |
495
|
|
|
* |
496
|
|
|
* @param bool $isRequirement |
497
|
|
|
* |
498
|
|
|
* @return GradebookCategory |
499
|
|
|
*/ |
500
|
|
|
public function setIsRequirement($isRequirement) |
501
|
|
|
{ |
502
|
|
|
$this->isRequirement = $isRequirement; |
503
|
|
|
|
504
|
|
|
return $this; |
505
|
|
|
} |
506
|
|
|
|
507
|
|
|
/** |
508
|
|
|
* Get isRequirement. |
509
|
|
|
* |
510
|
|
|
* @return bool |
511
|
|
|
*/ |
512
|
|
|
public function getIsRequirement() |
513
|
|
|
{ |
514
|
|
|
return $this->isRequirement; |
515
|
|
|
} |
516
|
|
|
|
517
|
|
|
public function getGradeBooksToValidateInDependence(): int |
518
|
|
|
{ |
519
|
|
|
return $this->gradeBooksToValidateInDependence; |
520
|
|
|
} |
521
|
|
|
|
522
|
|
|
public function setGradeBooksToValidateInDependence(int $value): self |
523
|
|
|
{ |
524
|
|
|
$this->gradeBooksToValidateInDependence = $value; |
525
|
|
|
|
526
|
|
|
return $this; |
527
|
|
|
} |
528
|
|
|
} |
529
|
|
|
|