1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare( strict_types = 1 ); |
4
|
|
|
|
5
|
|
|
namespace WMDE\Fundraising\Entities; |
6
|
|
|
|
7
|
|
|
use Doctrine\ORM\Mapping as ORM; |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* @since 2.0 |
11
|
|
|
* |
12
|
|
|
* @ORM\Table( |
13
|
|
|
* name="users", |
14
|
|
|
* uniqueConstraints={ |
15
|
|
|
* @ORM\UniqueConstraint(name="user_name", columns={"user_name"}), |
16
|
|
|
* @ORM\UniqueConstraint(name="user_address", columns={"user_address"}) |
17
|
|
|
* } |
18
|
|
|
* ) |
19
|
|
|
* @ORM\Entity |
20
|
|
|
*/ |
21
|
|
|
class User { |
22
|
|
|
/** |
23
|
|
|
* @var string |
24
|
|
|
* |
25
|
|
|
* @ORM\Column(name="user_name", type="string", length=32, options={"default":""}, nullable=false) |
26
|
|
|
*/ |
27
|
|
|
private $userName = ''; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @var string |
31
|
|
|
* |
32
|
|
|
* @ORM\Column(name="user_address", type="string", length=64, options={"default":""}, nullable=false) |
33
|
|
|
*/ |
34
|
|
|
private $userAddress = ''; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @var string |
38
|
|
|
* |
39
|
|
|
* @ORM\Column(name="user_pass", type="string", length=32, options={"default":""}, nullable=false) |
40
|
|
|
*/ |
41
|
|
|
private $userPass = ''; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @var \DateTime |
45
|
|
|
* |
46
|
|
|
* @ORM\Column(name="user_pass_expiry", type="datetime", options={"default":"1970-01-01 00:00:00"}, nullable=true) |
47
|
|
|
*/ |
48
|
|
|
private $userPassExpiry = '1970-01-01 00:00:00'; |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @var boolean |
52
|
|
|
* |
53
|
|
|
* @ORM\Column(name="user_pass_notification", type="boolean", nullable=true) |
54
|
|
|
*/ |
55
|
|
|
private $userPassNotification; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @var boolean |
59
|
|
|
* |
60
|
|
|
* @ORM\Column(name="user_role", type="boolean", options={"default":0}, nullable=true) |
61
|
|
|
*/ |
62
|
|
|
private $userRole = 0; |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @var boolean |
66
|
|
|
* |
67
|
|
|
* @ORM\Column(name="user_active", type="boolean", options={"default":0}, nullable=true) |
68
|
|
|
*/ |
69
|
|
|
private $userActive = 0; |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @var integer |
73
|
|
|
* |
74
|
|
|
* @ORM\Column(name="user_id", type="integer") |
75
|
|
|
* @ORM\Id |
76
|
|
|
* @ORM\GeneratedValue(strategy="IDENTITY") |
77
|
|
|
*/ |
78
|
|
|
private $userId; |
79
|
|
|
|
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* Set userName |
83
|
|
|
* |
84
|
|
|
* @param string $userName |
85
|
|
|
* @return self |
86
|
|
|
*/ |
87
|
|
|
public function setUserName( $userName ) { |
88
|
|
|
$this->userName = $userName; |
89
|
|
|
|
90
|
|
|
return $this; |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* Get userName |
95
|
|
|
* |
96
|
|
|
* @return string |
97
|
|
|
*/ |
98
|
|
|
public function getUserName() { |
99
|
|
|
return $this->userName; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* Set userAddress |
104
|
|
|
* |
105
|
|
|
* @param string $userAddress |
106
|
|
|
* @return self |
107
|
|
|
*/ |
108
|
|
|
public function setUserAddress( $userAddress ) { |
109
|
|
|
$this->userAddress = $userAddress; |
110
|
|
|
|
111
|
|
|
return $this; |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* Get userAddress |
116
|
|
|
* |
117
|
|
|
* @return string |
118
|
|
|
*/ |
119
|
|
|
public function getUserAddress() { |
120
|
|
|
return $this->userAddress; |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
/** |
124
|
|
|
* Set userPass |
125
|
|
|
* |
126
|
|
|
* @param string $userPass |
127
|
|
|
* @return self |
128
|
|
|
*/ |
129
|
|
|
public function setUserPass( $userPass ) { |
130
|
|
|
$this->userPass = $userPass; |
131
|
|
|
|
132
|
|
|
return $this; |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
/** |
136
|
|
|
* Get userPass |
137
|
|
|
* |
138
|
|
|
* @return string |
139
|
|
|
*/ |
140
|
|
|
public function getUserPass() { |
141
|
|
|
return $this->userPass; |
142
|
|
|
} |
143
|
|
|
|
144
|
|
|
/** |
145
|
|
|
* Set userPassExpiry |
146
|
|
|
* |
147
|
|
|
* @param \DateTime $userPassExpiry |
148
|
|
|
* @return self |
149
|
|
|
*/ |
150
|
|
|
public function setUserPassExpiry( $userPassExpiry ) { |
151
|
|
|
$this->userPassExpiry = $userPassExpiry; |
152
|
|
|
|
153
|
|
|
return $this; |
154
|
|
|
} |
155
|
|
|
|
156
|
|
|
/** |
157
|
|
|
* Get userPassExpiry |
158
|
|
|
* |
159
|
|
|
* @return \DateTime |
160
|
|
|
*/ |
161
|
|
|
public function getUserPassExpiry() { |
162
|
|
|
return $this->userPassExpiry; |
163
|
|
|
} |
164
|
|
|
|
165
|
|
|
/** |
166
|
|
|
* Set userPassNotification |
167
|
|
|
* |
168
|
|
|
* @param boolean $userPassNotification |
169
|
|
|
* @return self |
170
|
|
|
*/ |
171
|
|
|
public function setUserPassNotification( $userPassNotification ) { |
172
|
|
|
$this->userPassNotification = $userPassNotification; |
173
|
|
|
|
174
|
|
|
return $this; |
175
|
|
|
} |
176
|
|
|
|
177
|
|
|
/** |
178
|
|
|
* Get userPassNotification |
179
|
|
|
* |
180
|
|
|
* @return boolean |
181
|
|
|
*/ |
182
|
|
|
public function getUserPassNotification() { |
183
|
|
|
return $this->userPassNotification; |
184
|
|
|
} |
185
|
|
|
|
186
|
|
|
/** |
187
|
|
|
* Set userRole |
188
|
|
|
* |
189
|
|
|
* @param boolean $userRole |
190
|
|
|
* @return self |
191
|
|
|
*/ |
192
|
|
|
public function setUserRole( $userRole ) { |
193
|
|
|
$this->userRole = $userRole; |
194
|
|
|
|
195
|
|
|
return $this; |
196
|
|
|
} |
197
|
|
|
|
198
|
|
|
/** |
199
|
|
|
* Get userRole |
200
|
|
|
* |
201
|
|
|
* @return boolean |
202
|
|
|
*/ |
203
|
|
|
public function getUserRole() { |
204
|
|
|
return $this->userRole; |
205
|
|
|
} |
206
|
|
|
|
207
|
|
|
/** |
208
|
|
|
* Set userActive |
209
|
|
|
* |
210
|
|
|
* @param boolean $userActive |
211
|
|
|
* @return self |
212
|
|
|
*/ |
213
|
|
|
public function setUserActive( $userActive ) { |
214
|
|
|
$this->userActive = $userActive; |
215
|
|
|
|
216
|
|
|
return $this; |
217
|
|
|
} |
218
|
|
|
|
219
|
|
|
/** |
220
|
|
|
* Get userActive |
221
|
|
|
* |
222
|
|
|
* @return boolean |
223
|
|
|
*/ |
224
|
|
|
public function getUserActive() { |
225
|
|
|
return $this->userActive; |
226
|
|
|
} |
227
|
|
|
|
228
|
|
|
/** |
229
|
|
|
* Get userId |
230
|
|
|
* |
231
|
|
|
* @return integer |
232
|
|
|
*/ |
233
|
|
|
public function getUserId() { |
234
|
|
|
return $this->userId; |
235
|
|
|
} |
236
|
|
|
} |
237
|
|
|
|