|
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 Chamilo\CoreBundle\Entity\User; |
|
10
|
|
|
use DateTime; |
|
11
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
12
|
|
|
|
|
13
|
|
|
/** |
|
14
|
|
|
* @ORM\Table( |
|
15
|
|
|
* name="c_forum_thread_qualify", |
|
16
|
|
|
* indexes={ |
|
17
|
|
|
* @ORM\Index(name="course", columns={"c_id"}), |
|
18
|
|
|
* @ORM\Index(name="user_id", columns={"user_id", "thread_id"}) |
|
19
|
|
|
* } |
|
20
|
|
|
* ) |
|
21
|
|
|
* @ORM\Entity |
|
22
|
|
|
*/ |
|
23
|
|
|
class CForumThreadQualify |
|
24
|
|
|
{ |
|
25
|
|
|
/** |
|
26
|
|
|
* @ORM\Column(name="iid", type="integer") |
|
27
|
|
|
* @ORM\Id |
|
28
|
|
|
* @ORM\GeneratedValue |
|
29
|
|
|
*/ |
|
30
|
|
|
protected int $iid; |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* @ORM\Column(name="c_id", type="integer") |
|
34
|
|
|
*/ |
|
35
|
|
|
protected int $cId; |
|
36
|
|
|
|
|
37
|
|
|
/** |
|
38
|
|
|
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User") |
|
39
|
|
|
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE") |
|
40
|
|
|
*/ |
|
41
|
|
|
protected User $user; |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CForumThread", inversedBy="qualifications") |
|
45
|
|
|
* @ORM\JoinColumn(name="thread_id", referencedColumnName="iid", nullable=true, onDelete="CASCADE") |
|
46
|
|
|
*/ |
|
47
|
|
|
protected CForumThread $thread; |
|
48
|
|
|
|
|
49
|
|
|
/** |
|
50
|
|
|
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User") |
|
51
|
|
|
* @ORM\JoinColumn(name="qualify_user_id", referencedColumnName="id", onDelete="CASCADE") |
|
52
|
|
|
*/ |
|
53
|
|
|
protected User $qualifyUser; |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* @ORM\Column(name="qualify", type="float", precision=6, scale=2, nullable=false) |
|
57
|
|
|
*/ |
|
58
|
|
|
protected float $qualify; |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* @ORM\Column(name="qualify_time", type="datetime", nullable=true) |
|
62
|
|
|
*/ |
|
63
|
|
|
protected ?DateTime $qualifyTime = null; |
|
64
|
|
|
|
|
65
|
|
|
public function setQualify(float $qualify): self |
|
66
|
|
|
{ |
|
67
|
|
|
$this->qualify = $qualify; |
|
68
|
|
|
|
|
69
|
|
|
return $this; |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
/** |
|
73
|
|
|
* Get qualify. |
|
74
|
|
|
* |
|
75
|
|
|
* @return float |
|
76
|
|
|
*/ |
|
77
|
|
|
public function getQualify() |
|
78
|
|
|
{ |
|
79
|
|
|
return $this->qualify; |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
public function setQualifyTime(DateTime $qualifyTime): self |
|
83
|
|
|
{ |
|
84
|
|
|
$this->qualifyTime = $qualifyTime; |
|
85
|
|
|
|
|
86
|
|
|
return $this; |
|
87
|
|
|
} |
|
88
|
|
|
|
|
89
|
|
|
/** |
|
90
|
|
|
* Get qualifyTime. |
|
91
|
|
|
* |
|
92
|
|
|
* @return DateTime |
|
93
|
|
|
*/ |
|
94
|
|
|
public function getQualifyTime() |
|
95
|
|
|
{ |
|
96
|
|
|
return $this->qualifyTime; |
|
97
|
|
|
} |
|
98
|
|
|
|
|
99
|
|
|
/** |
|
100
|
|
|
* Set cId. |
|
101
|
|
|
* |
|
102
|
|
|
* @return CForumThreadQualify |
|
103
|
|
|
*/ |
|
104
|
|
|
public function setCId(int $cId) |
|
105
|
|
|
{ |
|
106
|
|
|
$this->cId = $cId; |
|
107
|
|
|
|
|
108
|
|
|
return $this; |
|
109
|
|
|
} |
|
110
|
|
|
|
|
111
|
|
|
/** |
|
112
|
|
|
* Get cId. |
|
113
|
|
|
* |
|
114
|
|
|
* @return int |
|
115
|
|
|
*/ |
|
116
|
|
|
public function getCId() |
|
117
|
|
|
{ |
|
118
|
|
|
return $this->cId; |
|
119
|
|
|
} |
|
120
|
|
|
|
|
121
|
|
|
public function getThread(): CForumThread |
|
122
|
|
|
{ |
|
123
|
|
|
return $this->thread; |
|
124
|
|
|
} |
|
125
|
|
|
|
|
126
|
|
|
public function setThread(CForumThread $thread): self |
|
127
|
|
|
{ |
|
128
|
|
|
$this->thread = $thread; |
|
129
|
|
|
|
|
130
|
|
|
return $this; |
|
131
|
|
|
} |
|
132
|
|
|
} |
|
133
|
|
|
|