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
|
|
|
* GradebookScoreLog. |
12
|
|
|
* |
13
|
|
|
* @ORM\Table( |
14
|
|
|
* name="gradebook_score_log", indexes={ |
15
|
|
|
* @ORM\Index(name="idx_gradebook_score_log_user", columns={"user_id"}), |
16
|
|
|
* @ORM\Index(name="idx_gradebook_score_log_user_category", columns={"user_id", "category_id"}) |
17
|
|
|
* } |
18
|
|
|
* ) |
19
|
|
|
* @ORM\Entity |
20
|
|
|
*/ |
21
|
|
|
class GradebookScoreLog |
22
|
|
|
{ |
23
|
|
|
use UserTrait; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @var int |
27
|
|
|
* |
28
|
|
|
* @ORM\Column(name="id", type="integer") |
29
|
|
|
* @ORM\Id |
30
|
|
|
* @ORM\GeneratedValue |
31
|
|
|
*/ |
32
|
|
|
protected $id; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @var int |
36
|
|
|
* |
37
|
|
|
* @ORM\Column(name="category_id", type="integer", nullable=false) |
38
|
|
|
*/ |
39
|
|
|
protected $categoryId; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @var User |
43
|
|
|
* |
44
|
|
|
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User", inversedBy="gradeBookScoreLogs") |
45
|
|
|
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE") |
46
|
|
|
*/ |
47
|
|
|
protected $user; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @var float |
51
|
|
|
* |
52
|
|
|
* @ORM\Column(name="score", type="float", precision=10, scale=0, nullable=false) |
53
|
|
|
*/ |
54
|
|
|
protected $score; |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @var \DateTime |
58
|
|
|
* |
59
|
|
|
* @ORM\Column(name="registered_at", type="datetime", nullable=false) |
60
|
|
|
*/ |
61
|
|
|
protected $registeredAt; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* Get the category id. |
65
|
|
|
* |
66
|
|
|
* @return int |
67
|
|
|
*/ |
68
|
|
|
public function getCategoryId() |
69
|
|
|
{ |
70
|
|
|
return $this->categoryId; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* Get the achieved score. |
75
|
|
|
* |
76
|
|
|
* @return float |
77
|
|
|
*/ |
78
|
|
|
public function getScore() |
79
|
|
|
{ |
80
|
|
|
return $this->score; |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* Get the datetime of register. |
85
|
|
|
* |
86
|
|
|
* @return \DateTime |
87
|
|
|
*/ |
88
|
|
|
public function getRegisteredAt() |
89
|
|
|
{ |
90
|
|
|
return $this->registeredAt; |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* Get the id. |
95
|
|
|
* |
96
|
|
|
* @return int |
97
|
|
|
*/ |
98
|
|
|
public function getId() |
99
|
|
|
{ |
100
|
|
|
return $this->id; |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* Set the category id. |
105
|
|
|
* |
106
|
|
|
* @param int $categoryId |
107
|
|
|
* |
108
|
|
|
* @return $this |
109
|
|
|
*/ |
110
|
|
|
public function setCategoryId($categoryId) |
111
|
|
|
{ |
112
|
|
|
$this->categoryId = $categoryId; |
113
|
|
|
|
114
|
|
|
return $this; |
115
|
|
|
} |
116
|
|
|
|
117
|
|
|
/** |
118
|
|
|
* Set the achieved score. |
119
|
|
|
* |
120
|
|
|
* @param float $score |
121
|
|
|
* |
122
|
|
|
* @return $this |
123
|
|
|
*/ |
124
|
|
|
public function setScore($score) |
125
|
|
|
{ |
126
|
|
|
$this->score = $score; |
127
|
|
|
|
128
|
|
|
return $this; |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
/** |
132
|
|
|
* Set the datetime of register. |
133
|
|
|
* |
134
|
|
|
* @return $this |
135
|
|
|
*/ |
136
|
|
|
public function setRegisteredAt(\DateTime $registeredAt) |
137
|
|
|
{ |
138
|
|
|
$this->registeredAt = $registeredAt; |
139
|
|
|
|
140
|
|
|
return $this; |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* Set the id. |
145
|
|
|
* |
146
|
|
|
* @param int $id |
147
|
|
|
* |
148
|
|
|
* @return $this |
149
|
|
|
*/ |
150
|
|
|
public function setId($id) |
151
|
|
|
{ |
152
|
|
|
$this->id = $id; |
153
|
|
|
|
154
|
|
|
return $this; |
155
|
|
|
} |
156
|
|
|
} |
157
|
|
|
|