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_user", columns={"guid"})}) |
12
|
|
|
* @ORM\Entity |
13
|
|
|
* @ORM\EntityListeners({"PiouPiou\RibsAdminBundle\EventListener\GuidAwareListener", "PiouPiou\RibsAdminBundle\EventListener\CreateUpdateAwareListener"}) |
14
|
|
|
*/ |
15
|
|
|
class User |
16
|
|
|
{ |
17
|
|
|
use GuidTrait; |
18
|
|
|
use CreatedUpdatedTrait; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* @var integer |
22
|
|
|
* |
23
|
|
|
* @ORM\Column(name="id", type="integer", nullable=false, options={"unsigned"=true}) |
24
|
|
|
* @ORM\Id |
25
|
|
|
* @ORM\GeneratedValue(strategy="IDENTITY") |
26
|
|
|
*/ |
27
|
|
|
private $id; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @var AccessRight |
31
|
|
|
* |
32
|
|
|
* @ORM\ManyToOne(targetEntity="PiouPiou\RibsAdminBundle\Entity\AccessRight", inversedBy="users") |
33
|
|
|
* @ORM\JoinColumn(name="id_access_right", referencedColumnName="id", nullable=true) |
34
|
|
|
*/ |
35
|
|
|
private $accessRightList; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @var boolean |
39
|
|
|
* |
40
|
|
|
* @ORM\Column(name="admin", type="boolean", nullable=true, options={"default": false}) |
41
|
|
|
*/ |
42
|
|
|
private $admin; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @var string |
46
|
|
|
* |
47
|
|
|
* @ORM\Column(name="firstname", type="string", length=255, nullable=false) |
48
|
|
|
*/ |
49
|
|
|
private $firstname; |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* @var string |
53
|
|
|
* |
54
|
|
|
* @ORM\Column(name="lastname", type="string", length=255, nullable=false) |
55
|
|
|
*/ |
56
|
|
|
private $lastname; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @var string |
60
|
|
|
* |
61
|
|
|
* @ORM\Column(name="adress", type="string", length=255, nullable=true) |
62
|
|
|
*/ |
63
|
|
|
private $adress; |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* @var string |
67
|
|
|
* |
68
|
|
|
* @ORM\Column(name="postal_code", type="string", length=100, nullable=true) |
69
|
|
|
*/ |
70
|
|
|
private $postalCode; |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* @var string |
74
|
|
|
* |
75
|
|
|
* @ORM\Column(name="country", type="string", length=100, nullable=true) |
76
|
|
|
*/ |
77
|
|
|
private $country; |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* @var string |
81
|
|
|
* |
82
|
|
|
* @ORM\Column(name="state", type="string", length=255, nullable=true) |
83
|
|
|
*/ |
84
|
|
|
private $state; |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @var string |
88
|
|
|
* |
89
|
|
|
* @ORM\Column(name="access_rights", type="text", nullable=true) |
90
|
|
|
*/ |
91
|
|
|
private $accessRights; |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* @var boolean |
95
|
|
|
* |
96
|
|
|
* @ORM\Column(name="archived", type="boolean", nullable=true, options={"default": false}) |
97
|
|
|
*/ |
98
|
|
|
private $archived = false; |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* @return int |
102
|
|
|
*/ |
103
|
|
|
public function getId() |
104
|
|
|
{ |
105
|
|
|
return $this->id; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* @param int $id |
110
|
|
|
*/ |
111
|
|
|
public function setId($id) |
112
|
|
|
{ |
113
|
|
|
$this->id = $id; |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* @return AccessRight |
118
|
|
|
*/ |
119
|
|
|
public function getAccessRightList() |
120
|
|
|
{ |
121
|
|
|
return $this->accessRightList; |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
/** |
125
|
|
|
* @param AccessRight $accessRightList |
126
|
|
|
*/ |
127
|
|
|
public function setAccessRightList($accessRightList) |
128
|
|
|
{ |
129
|
|
|
$this->accessRightList = $accessRightList; |
130
|
|
|
} |
131
|
|
|
|
132
|
|
|
/** |
133
|
|
|
* @return bool |
134
|
|
|
*/ |
135
|
|
|
public function getAdmin(): ?bool |
136
|
|
|
{ |
137
|
|
|
return $this->admin; |
138
|
|
|
} |
139
|
|
|
|
140
|
|
|
/** |
141
|
|
|
* @param bool $admin |
142
|
|
|
*/ |
143
|
|
|
public function setAdmin(bool $admin) |
144
|
|
|
{ |
145
|
|
|
$this->admin = $admin; |
146
|
|
|
} |
147
|
|
|
|
148
|
|
|
/** |
149
|
|
|
* @return string |
150
|
|
|
*/ |
151
|
|
|
public function getFirstname() |
152
|
|
|
{ |
153
|
|
|
return $this->firstname; |
154
|
|
|
} |
155
|
|
|
|
156
|
|
|
/** |
157
|
|
|
* @param string $firstname |
158
|
|
|
*/ |
159
|
|
|
public function setFirstname($firstname) |
160
|
|
|
{ |
161
|
|
|
$this->firstname = $firstname; |
162
|
|
|
} |
163
|
|
|
|
164
|
|
|
/** |
165
|
|
|
* @return string |
166
|
|
|
*/ |
167
|
|
|
public function getLastname() |
168
|
|
|
{ |
169
|
|
|
return $this->lastname; |
170
|
|
|
} |
171
|
|
|
|
172
|
|
|
/** |
173
|
|
|
* @param string $lastname |
174
|
|
|
*/ |
175
|
|
|
public function setLastname($lastname) |
176
|
|
|
{ |
177
|
|
|
$this->lastname = $lastname; |
178
|
|
|
} |
179
|
|
|
|
180
|
|
|
/** |
181
|
|
|
* @return string |
182
|
|
|
*/ |
183
|
|
|
public function getAdress() |
184
|
|
|
{ |
185
|
|
|
return $this->adress; |
186
|
|
|
} |
187
|
|
|
|
188
|
|
|
/** |
189
|
|
|
* @param string $adress |
190
|
|
|
*/ |
191
|
|
|
public function setAdress($adress) |
192
|
|
|
{ |
193
|
|
|
$this->adress = $adress; |
194
|
|
|
} |
195
|
|
|
|
196
|
|
|
/** |
197
|
|
|
* @return string |
198
|
|
|
*/ |
199
|
|
|
public function getPostalCode() |
200
|
|
|
{ |
201
|
|
|
return $this->postalCode; |
202
|
|
|
} |
203
|
|
|
|
204
|
|
|
/** |
205
|
|
|
* @param string $postalCode |
206
|
|
|
*/ |
207
|
|
|
public function setPostalCode($postalCode) |
208
|
|
|
{ |
209
|
|
|
$this->postalCode = $postalCode; |
210
|
|
|
} |
211
|
|
|
|
212
|
|
|
/** |
213
|
|
|
* @return string |
214
|
|
|
*/ |
215
|
|
|
public function getCountry() |
216
|
|
|
{ |
217
|
|
|
return $this->country; |
218
|
|
|
} |
219
|
|
|
|
220
|
|
|
/** |
221
|
|
|
* @param string $country |
222
|
|
|
*/ |
223
|
|
|
public function setCountry($country) |
224
|
|
|
{ |
225
|
|
|
$this->country = $country; |
226
|
|
|
} |
227
|
|
|
|
228
|
|
|
/** |
229
|
|
|
* @return string |
230
|
|
|
*/ |
231
|
|
|
public function getState() |
232
|
|
|
{ |
233
|
|
|
return $this->state; |
234
|
|
|
} |
235
|
|
|
|
236
|
|
|
/** |
237
|
|
|
* @param string $state |
238
|
|
|
*/ |
239
|
|
|
public function setState($state) |
240
|
|
|
{ |
241
|
|
|
$this->state = $state; |
242
|
|
|
} |
243
|
|
|
|
244
|
|
|
/** |
245
|
|
|
* @return string |
246
|
|
|
*/ |
247
|
|
|
public function getAccessRights() |
248
|
|
|
{ |
249
|
|
|
return $this->accessRights; |
250
|
|
|
} |
251
|
|
|
|
252
|
|
|
/** |
253
|
|
|
* @param string $accessRights |
254
|
|
|
*/ |
255
|
|
|
public function setAccessRights($accessRights) |
256
|
|
|
{ |
257
|
|
|
$this->accessRights = $accessRights; |
258
|
|
|
} |
259
|
|
|
|
260
|
|
|
/** |
261
|
|
|
* @return boolean |
262
|
|
|
*/ |
263
|
|
|
public function getArchived(): ?bool |
264
|
|
|
{ |
265
|
|
|
return $this->archived; |
266
|
|
|
} |
267
|
|
|
|
268
|
|
|
/** |
269
|
|
|
* @param boolean $archived |
270
|
|
|
*/ |
271
|
|
|
public function setArchived(bool $archived) |
272
|
|
|
{ |
273
|
|
|
$this->archived = $archived; |
274
|
|
|
} |
275
|
|
|
|
276
|
|
|
public function __toString() |
277
|
|
|
{ |
278
|
|
|
return $this->getFirstname() . " " . $this->getLastname(); |
279
|
|
|
} |
280
|
|
|
} |
281
|
|
|
|
282
|
|
|
|