Passed
Push — master ( 6304f4...fc13ff )
by Julito
08:01
created

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