1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* For licensing terms, see /license.txt */ |
6
|
|
|
|
7
|
|
|
namespace Chamilo\CourseBundle\Entity; |
8
|
|
|
|
9
|
|
|
use Doctrine\ORM\Mapping as ORM; |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* Quiz rel question categories. |
13
|
|
|
* |
14
|
|
|
* @ORM\Table(name="c_quiz_rel_category") |
15
|
|
|
* @ORM\Entity |
16
|
|
|
*/ |
17
|
|
|
class CQuizRelQuestionCategory |
18
|
|
|
{ |
19
|
|
|
/** |
20
|
|
|
* @ORM\Column(name="iid", type="bigint") |
21
|
|
|
* @ORM\Id |
22
|
|
|
* @ORM\GeneratedValue |
23
|
|
|
*/ |
24
|
|
|
protected int $iid; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @ORM\ManyToOne(targetEntity="CQuizQuestionCategory", cascade={"persist"}) |
28
|
|
|
* @ORM\JoinColumn(name="category_id", referencedColumnName="iid", onDelete="CASCADE") |
29
|
|
|
*/ |
30
|
|
|
protected CQuizQuestionCategory $category; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @ORM\ManyToOne(targetEntity="CQuiz", inversedBy="questionsCategories", cascade={"persist"}) |
34
|
|
|
* @ORM\JoinColumn(name="exercise_id", referencedColumnName="iid", onDelete="CASCADE") |
35
|
|
|
*/ |
36
|
|
|
protected CQuiz $quiz; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @ORM\Column(name="count_questions", type="integer", nullable=false) |
40
|
|
|
*/ |
41
|
|
|
protected int $countQuestions; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @return int |
45
|
|
|
*/ |
46
|
|
|
public function getIid() |
47
|
|
|
{ |
48
|
|
|
return $this->iid; |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
public function getCategory(): CQuizQuestionCategory |
52
|
|
|
{ |
53
|
|
|
return $this->category; |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
public function setCategory(CQuizQuestionCategory $category): self |
57
|
|
|
{ |
58
|
|
|
$this->category = $category; |
59
|
|
|
|
60
|
|
|
return $this; |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
public function getQuiz(): CQuiz |
64
|
|
|
{ |
65
|
|
|
return $this->quiz; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
public function setQuiz(CQuiz $quiz): self |
69
|
|
|
{ |
70
|
|
|
$this->quiz = $quiz; |
71
|
|
|
|
72
|
|
|
return $this; |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
public function getCountQuestions(): int |
76
|
|
|
{ |
77
|
|
|
return $this->countQuestions; |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
public function setCountQuestions(int $countQuestions): self |
81
|
|
|
{ |
82
|
|
|
$this->countQuestions = $countQuestions; |
83
|
|
|
|
84
|
|
|
return $this; |
85
|
|
|
} |
86
|
|
|
} |
87
|
|
|
|