1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace PiouPiou\RibsAdminBundle\Entity; |
4
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
6
|
|
|
use Gedmo\Mapping\Annotation as Gedmo; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* User |
10
|
|
|
* |
11
|
|
|
* @ORM\Table(name="user", uniqueConstraints={@ORM\UniqueConstraint(name="guid_UNIQUE", columns={"guid"})}) |
12
|
|
|
* @ORM\Entity |
13
|
|
|
* @ORM\EntityListeners({"PiouPiou\RibsAdminBundle\EventListener\GuidAwareListener", "PiouPiou\RibsAdminBundle\EventListener\CreateUpdateAwareListener"}) |
14
|
|
|
*/ |
15
|
|
|
class User |
16
|
|
|
{ |
17
|
|
|
/** |
18
|
|
|
* @var integer |
19
|
|
|
* |
20
|
|
|
* @ORM\Column(name="id", type="integer", nullable=false, options={"unsigned"=true}) |
21
|
|
|
* @ORM\Id |
22
|
|
|
* @ORM\GeneratedValue(strategy="IDENTITY") |
23
|
|
|
*/ |
24
|
|
|
private $id; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @var string |
28
|
|
|
* |
29
|
|
|
* @ORM\Column(name="guid", type="string", length=255, nullable=false) |
30
|
|
|
*/ |
31
|
|
|
private $guid; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var AccessRight |
35
|
|
|
* |
36
|
|
|
* @ORM\ManyToOne(targetEntity="PiouPiou\RibsAdminBundle\Entity\AccessRight", inversedBy="users") |
37
|
|
|
* @ORM\JoinColumn(name="id_access_right", referencedColumnName="id", nullable=true) |
38
|
|
|
*/ |
39
|
|
|
private $accessRightList; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @var boolean |
43
|
|
|
* |
44
|
|
|
* @ORM\Column(name="admin", type="boolean", nullable=true, options={"default": false}) |
45
|
|
|
*/ |
46
|
|
|
private $admin; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @var string |
50
|
|
|
* |
51
|
|
|
* @ORM\Column(name="firstname", type="string", length=255, nullable=false) |
52
|
|
|
*/ |
53
|
|
|
private $firstname; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* @var string |
57
|
|
|
* |
58
|
|
|
* @ORM\Column(name="lastname", type="string", length=255, nullable=false) |
59
|
|
|
*/ |
60
|
|
|
private $lastname; |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @var string |
64
|
|
|
* |
65
|
|
|
* @ORM\Column(name="adress", type="string", length=255, nullable=true) |
66
|
|
|
*/ |
67
|
|
|
private $adress; |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* @var string |
71
|
|
|
* |
72
|
|
|
* @ORM\Column(name="postal_code", type="string", length=100, nullable=true) |
73
|
|
|
*/ |
74
|
|
|
private $postalCode; |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* @var string |
78
|
|
|
* |
79
|
|
|
* @ORM\Column(name="country", type="string", length=100, nullable=true) |
80
|
|
|
*/ |
81
|
|
|
private $country; |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* @var string |
85
|
|
|
* |
86
|
|
|
* @ORM\Column(name="state", type="string", length=255, nullable=true) |
87
|
|
|
*/ |
88
|
|
|
private $state; |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @var string |
92
|
|
|
* |
93
|
|
|
* @ORM\Column(name="access_rights", type="text", nullable=true) |
94
|
|
|
*/ |
95
|
|
|
private $accessRights; |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* @var boolean |
99
|
|
|
* |
100
|
|
|
* @ORM\Column(name="archived", type="boolean", nullable=true, options={"default": false}) |
101
|
|
|
*/ |
102
|
|
|
private $archived = false; |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* @ORM\Column(name="created_at", type="datetime", nullable=true) |
106
|
|
|
*/ |
107
|
|
|
protected $created_at; |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* @ORM\ManyToOne(targetEntity="PiouPiou\RibsAdminBundle\Entity\User") |
111
|
|
|
* @ORM\JoinColumn(name="created_by", referencedColumnName="id", nullable=false) |
112
|
|
|
*/ |
113
|
|
|
protected $created_by; |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* @ORM\Column(name="updated_at", type="datetime", nullable=true) |
117
|
|
|
*/ |
118
|
|
|
protected $updated_at; |
119
|
|
|
|
120
|
|
|
/** |
121
|
|
|
* @ORM\ManyToOne(targetEntity="PiouPiou\RibsAdminBundle\Entity\User") |
122
|
|
|
* @ORM\JoinColumn(name="updated_by", referencedColumnName="id", nullable=false) |
123
|
|
|
*/ |
124
|
|
|
protected $updated_by; |
125
|
|
|
|
126
|
|
|
/** |
127
|
|
|
* @return int |
128
|
|
|
*/ |
129
|
|
|
public function getId() |
130
|
|
|
{ |
131
|
|
|
return $this->id; |
132
|
|
|
} |
133
|
|
|
|
134
|
|
|
/** |
135
|
|
|
* @param int $id |
136
|
|
|
*/ |
137
|
|
|
public function setId($id) |
138
|
|
|
{ |
139
|
|
|
$this->id = $id; |
140
|
|
|
} |
141
|
|
|
|
142
|
|
|
/** |
143
|
|
|
* @return string |
144
|
|
|
*/ |
145
|
|
|
public function getGuid() |
146
|
|
|
{ |
147
|
|
|
return $this->guid; |
148
|
|
|
} |
149
|
|
|
|
150
|
|
|
/** |
151
|
|
|
* @param string $guid |
152
|
|
|
*/ |
153
|
|
|
public function setGuid($guid) |
154
|
|
|
{ |
155
|
|
|
$this->guid = $guid; |
156
|
|
|
} |
157
|
|
|
|
158
|
|
|
/** |
159
|
|
|
* @return AccessRight |
160
|
|
|
*/ |
161
|
|
|
public function getAccessRightList() |
162
|
|
|
{ |
163
|
|
|
return $this->accessRightList; |
164
|
|
|
} |
165
|
|
|
|
166
|
|
|
/** |
167
|
|
|
* @param AccessRight $accessRightList |
168
|
|
|
*/ |
169
|
|
|
public function setAccessRightList($accessRightList) |
170
|
|
|
{ |
171
|
|
|
$this->accessRightList = $accessRightList; |
172
|
|
|
} |
173
|
|
|
|
174
|
|
|
/** |
175
|
|
|
* @return bool |
176
|
|
|
*/ |
177
|
|
|
public function getAdmin(): ?bool |
178
|
|
|
{ |
179
|
|
|
return $this->admin; |
180
|
|
|
} |
181
|
|
|
|
182
|
|
|
/** |
183
|
|
|
* @param bool $admin |
184
|
|
|
*/ |
185
|
|
|
public function setAdmin(bool $admin) |
186
|
|
|
{ |
187
|
|
|
$this->admin = $admin; |
188
|
|
|
} |
189
|
|
|
|
190
|
|
|
/** |
191
|
|
|
* @return string |
192
|
|
|
*/ |
193
|
|
|
public function getFirstname() |
194
|
|
|
{ |
195
|
|
|
return $this->firstname; |
196
|
|
|
} |
197
|
|
|
|
198
|
|
|
/** |
199
|
|
|
* @param string $firstname |
200
|
|
|
*/ |
201
|
|
|
public function setFirstname($firstname) |
202
|
|
|
{ |
203
|
|
|
$this->firstname = $firstname; |
204
|
|
|
} |
205
|
|
|
|
206
|
|
|
/** |
207
|
|
|
* @return string |
208
|
|
|
*/ |
209
|
|
|
public function getLastname() |
210
|
|
|
{ |
211
|
|
|
return $this->lastname; |
212
|
|
|
} |
213
|
|
|
|
214
|
|
|
/** |
215
|
|
|
* @param string $lastname |
216
|
|
|
*/ |
217
|
|
|
public function setLastname($lastname) |
218
|
|
|
{ |
219
|
|
|
$this->lastname = $lastname; |
220
|
|
|
} |
221
|
|
|
|
222
|
|
|
/** |
223
|
|
|
* @return string |
224
|
|
|
*/ |
225
|
|
|
public function getAdress() |
226
|
|
|
{ |
227
|
|
|
return $this->adress; |
228
|
|
|
} |
229
|
|
|
|
230
|
|
|
/** |
231
|
|
|
* @param string $adress |
232
|
|
|
*/ |
233
|
|
|
public function setAdress($adress) |
234
|
|
|
{ |
235
|
|
|
$this->adress = $adress; |
236
|
|
|
} |
237
|
|
|
|
238
|
|
|
/** |
239
|
|
|
* @return string |
240
|
|
|
*/ |
241
|
|
|
public function getPostalCode() |
242
|
|
|
{ |
243
|
|
|
return $this->postalCode; |
244
|
|
|
} |
245
|
|
|
|
246
|
|
|
/** |
247
|
|
|
* @param string $postalCode |
248
|
|
|
*/ |
249
|
|
|
public function setPostalCode($postalCode) |
250
|
|
|
{ |
251
|
|
|
$this->postalCode = $postalCode; |
252
|
|
|
} |
253
|
|
|
|
254
|
|
|
/** |
255
|
|
|
* @return string |
256
|
|
|
*/ |
257
|
|
|
public function getCountry() |
258
|
|
|
{ |
259
|
|
|
return $this->country; |
260
|
|
|
} |
261
|
|
|
|
262
|
|
|
/** |
263
|
|
|
* @param string $country |
264
|
|
|
*/ |
265
|
|
|
public function setCountry($country) |
266
|
|
|
{ |
267
|
|
|
$this->country = $country; |
268
|
|
|
} |
269
|
|
|
|
270
|
|
|
/** |
271
|
|
|
* @return string |
272
|
|
|
*/ |
273
|
|
|
public function getState() |
274
|
|
|
{ |
275
|
|
|
return $this->state; |
276
|
|
|
} |
277
|
|
|
|
278
|
|
|
/** |
279
|
|
|
* @param string $state |
280
|
|
|
*/ |
281
|
|
|
public function setState($state) |
282
|
|
|
{ |
283
|
|
|
$this->state = $state; |
284
|
|
|
} |
285
|
|
|
|
286
|
|
|
/** |
287
|
|
|
* @return string |
288
|
|
|
*/ |
289
|
|
|
public function getAccessRights() |
290
|
|
|
{ |
291
|
|
|
return $this->accessRights; |
292
|
|
|
} |
293
|
|
|
|
294
|
|
|
/** |
295
|
|
|
* @param string $accessRights |
296
|
|
|
*/ |
297
|
|
|
public function setAccessRights($accessRights) |
298
|
|
|
{ |
299
|
|
|
$this->accessRights = $accessRights; |
300
|
|
|
} |
301
|
|
|
|
302
|
|
|
/** |
303
|
|
|
* @return boolean |
304
|
|
|
*/ |
305
|
|
|
public function getArchived(): ?bool |
306
|
|
|
{ |
307
|
|
|
return $this->archived; |
308
|
|
|
} |
309
|
|
|
|
310
|
|
|
/** |
311
|
|
|
* @param boolean $archived |
312
|
|
|
*/ |
313
|
|
|
public function setArchived(bool $archived) |
314
|
|
|
{ |
315
|
|
|
$this->archived = $archived; |
316
|
|
|
} |
317
|
|
|
|
318
|
|
|
/** |
319
|
|
|
* @return mixed |
320
|
|
|
*/ |
321
|
|
|
public function getCreatedAt() |
322
|
|
|
{ |
323
|
|
|
return $this->created_at; |
324
|
|
|
} |
325
|
|
|
|
326
|
|
|
/** |
327
|
|
|
* @param mixed $created_at |
328
|
|
|
* @return User |
329
|
|
|
*/ |
330
|
|
|
public function setCreatedAt($created_at): User |
331
|
|
|
{ |
332
|
|
|
$this->created_at = $created_at; |
333
|
|
|
|
334
|
|
|
return $this; |
335
|
|
|
} |
336
|
|
|
|
337
|
|
|
/** |
338
|
|
|
* @return mixed |
339
|
|
|
*/ |
340
|
|
|
public function getCreatedBy() |
341
|
|
|
{ |
342
|
|
|
return $this->created_by; |
343
|
|
|
} |
344
|
|
|
|
345
|
|
|
/** |
346
|
|
|
* @ORM\PrePersist |
347
|
|
|
* @param mixed $created_by |
348
|
|
|
* @return User |
349
|
|
|
*/ |
350
|
|
|
public function setCreatedBy($created_by): User |
351
|
|
|
{ |
352
|
|
|
$this->created_by = $created_by; |
353
|
|
|
|
354
|
|
|
return $this; |
355
|
|
|
} |
356
|
|
|
|
357
|
|
|
/** |
358
|
|
|
* @return mixed |
359
|
|
|
*/ |
360
|
|
|
public function getUpdatedAt() |
361
|
|
|
{ |
362
|
|
|
return $this->updated_at; |
363
|
|
|
} |
364
|
|
|
|
365
|
|
|
/** |
366
|
|
|
* @param mixed $updated_at |
367
|
|
|
* @return User |
368
|
|
|
*/ |
369
|
|
|
public function setUpdatedAt($updated_at): User |
370
|
|
|
{ |
371
|
|
|
$this->updated_at = $updated_at; |
372
|
|
|
|
373
|
|
|
return $this; |
374
|
|
|
} |
375
|
|
|
|
376
|
|
|
/** |
377
|
|
|
* @return mixed |
378
|
|
|
*/ |
379
|
|
|
public function getUpdatedBy() |
380
|
|
|
{ |
381
|
|
|
return $this->updated_by; |
382
|
|
|
} |
383
|
|
|
|
384
|
|
|
/** |
385
|
|
|
* @ORM\PreUpdate |
386
|
|
|
* @param mixed $updated_by |
387
|
|
|
* @return User |
388
|
|
|
*/ |
389
|
|
|
public function setUpdatedBy($updated_by): User |
390
|
|
|
{ |
391
|
|
|
$this->updated_by = $updated_by; |
392
|
|
|
|
393
|
|
|
return $this; |
394
|
|
|
} |
395
|
|
|
} |
396
|
|
|
|
397
|
|
|
|