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
|
|
|
* UserRelCourseVote. |
12
|
|
|
* |
13
|
|
|
* @ORM\Table(name="user_rel_course_vote", indexes={ |
14
|
|
|
* @ORM\Index(name="idx_ucv_cid", columns={"c_id"}), |
15
|
|
|
* @ORM\Index(name="idx_ucv_uid", columns={"user_id"}), |
16
|
|
|
* @ORM\Index(name="idx_ucv_cuid", columns={"user_id", "c_id"}) |
17
|
|
|
* }) |
18
|
|
|
* @ORM\Entity |
19
|
|
|
*/ |
20
|
|
|
class UserRelCourseVote |
21
|
|
|
{ |
22
|
|
|
use UserTrait; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @var int |
26
|
|
|
* |
27
|
|
|
* @ORM\Column(name="id", type="integer") |
28
|
|
|
* @ORM\Id |
29
|
|
|
* @ORM\GeneratedValue(strategy="IDENTITY") |
30
|
|
|
*/ |
31
|
|
|
protected $id; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var int |
35
|
|
|
* |
36
|
|
|
* @ORM\Column(name="c_id", type="integer", nullable=false) |
37
|
|
|
*/ |
38
|
|
|
protected $cId; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @var User |
42
|
|
|
* |
43
|
|
|
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\User", inversedBy="userRelCourseVotes") |
44
|
|
|
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE") |
45
|
|
|
*/ |
46
|
|
|
protected $user; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @var int |
50
|
|
|
* |
51
|
|
|
* @ORM\Column(name="session_id", type="integer", nullable=false) |
52
|
|
|
*/ |
53
|
|
|
protected $sessionId; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* @var int |
57
|
|
|
* |
58
|
|
|
* @ORM\Column(name="url_id", type="integer", nullable=false) |
59
|
|
|
*/ |
60
|
|
|
protected $urlId; |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @var int |
64
|
|
|
* |
65
|
|
|
* @ORM\Column(name="vote", type="integer", nullable=false) |
66
|
|
|
*/ |
67
|
|
|
protected $vote; |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* Set cId. |
71
|
|
|
* |
72
|
|
|
* @param int $cId |
73
|
|
|
* |
74
|
|
|
* @return UserRelCourseVote |
75
|
|
|
*/ |
76
|
|
|
public function setCId($cId) |
77
|
|
|
{ |
78
|
|
|
$this->cId = $cId; |
79
|
|
|
|
80
|
|
|
return $this; |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* Get cId. |
85
|
|
|
* |
86
|
|
|
* @return int |
87
|
|
|
*/ |
88
|
|
|
public function getCId() |
89
|
|
|
{ |
90
|
|
|
return $this->cId; |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* Set sessionId. |
95
|
|
|
* |
96
|
|
|
* @param int $sessionId |
97
|
|
|
* |
98
|
|
|
* @return UserRelCourseVote |
99
|
|
|
*/ |
100
|
|
|
public function setSessionId($sessionId) |
101
|
|
|
{ |
102
|
|
|
$this->sessionId = $sessionId; |
103
|
|
|
|
104
|
|
|
return $this; |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* Get sessionId. |
109
|
|
|
* |
110
|
|
|
* @return int |
111
|
|
|
*/ |
112
|
|
|
public function getSessionId() |
113
|
|
|
{ |
114
|
|
|
return $this->sessionId; |
115
|
|
|
} |
116
|
|
|
|
117
|
|
|
/** |
118
|
|
|
* Set urlId. |
119
|
|
|
* |
120
|
|
|
* @param int $urlId |
121
|
|
|
* |
122
|
|
|
* @return UserRelCourseVote |
123
|
|
|
*/ |
124
|
|
|
public function setUrlId($urlId) |
125
|
|
|
{ |
126
|
|
|
$this->urlId = $urlId; |
127
|
|
|
|
128
|
|
|
return $this; |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
/** |
132
|
|
|
* Get urlId. |
133
|
|
|
* |
134
|
|
|
* @return int |
135
|
|
|
*/ |
136
|
|
|
public function getUrlId() |
137
|
|
|
{ |
138
|
|
|
return $this->urlId; |
139
|
|
|
} |
140
|
|
|
|
141
|
|
|
/** |
142
|
|
|
* Set vote. |
143
|
|
|
* |
144
|
|
|
* @param int $vote |
145
|
|
|
* |
146
|
|
|
* @return UserRelCourseVote |
147
|
|
|
*/ |
148
|
|
|
public function setVote($vote) |
149
|
|
|
{ |
150
|
|
|
$this->vote = $vote; |
151
|
|
|
|
152
|
|
|
return $this; |
153
|
|
|
} |
154
|
|
|
|
155
|
|
|
/** |
156
|
|
|
* Get vote. |
157
|
|
|
* |
158
|
|
|
* @return int |
159
|
|
|
*/ |
160
|
|
|
public function getVote() |
161
|
|
|
{ |
162
|
|
|
return $this->vote; |
163
|
|
|
} |
164
|
|
|
|
165
|
|
|
/** |
166
|
|
|
* Get id. |
167
|
|
|
* |
168
|
|
|
* @return int |
169
|
|
|
*/ |
170
|
|
|
public function getId() |
171
|
|
|
{ |
172
|
|
|
return $this->id; |
173
|
|
|
} |
174
|
|
|
} |
175
|
|
|
|