1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* @license MIT, http://opensource.org/licenses/MIT |
5
|
|
|
* @copyright Aimeos (aimeos.org), 2014 |
6
|
|
|
*/ |
7
|
|
|
|
8
|
|
|
|
9
|
|
|
namespace Aimeos\ShopBundle\Entity; |
10
|
|
|
|
11
|
|
|
use Doctrine\ORM\Mapping as ORM; |
12
|
|
|
use Symfony\Component\Security\Core\User\UserInterface; |
13
|
|
|
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface; |
14
|
|
|
|
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* @ORM\Entity |
18
|
|
|
* @ORM\Table("mshop_customer") |
19
|
|
|
*/ |
20
|
|
|
class User implements UserInterface, PasswordAuthenticatedUserInterface |
21
|
|
|
{ |
22
|
|
|
/** |
23
|
|
|
* @ORM\Id |
24
|
|
|
* @ORM\Column("id") |
25
|
|
|
*/ |
26
|
|
|
protected $id; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @ORM\Column("siteid") |
30
|
|
|
*/ |
31
|
|
|
protected $siteid; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @ORM\Column("label") |
35
|
|
|
*/ |
36
|
|
|
protected $label; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @ORM\Column("code") |
40
|
|
|
*/ |
41
|
|
|
protected $username; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @ORM\Column("password") |
45
|
|
|
*/ |
46
|
|
|
protected $password; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @ORM\Column("status") |
50
|
|
|
*/ |
51
|
|
|
protected $isActive; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @ORM\Column("salutation") |
55
|
|
|
*/ |
56
|
|
|
protected $salutation = ''; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @ORM\Column("company") |
60
|
|
|
*/ |
61
|
|
|
protected $company = ''; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @ORM\Column("vatid") |
65
|
|
|
*/ |
66
|
|
|
protected $vatid = ''; |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @ORM\Column("title") |
70
|
|
|
*/ |
71
|
|
|
protected $title = ''; |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* @ORM\Column("firstname") |
75
|
|
|
*/ |
76
|
|
|
protected $firstname = ''; |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @ORM\Column("lastname") |
80
|
|
|
*/ |
81
|
|
|
protected $lastname = ''; |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* @ORM\Column("address1") |
85
|
|
|
*/ |
86
|
|
|
protected $address1 = ''; |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* @ORM\Column("address2") |
90
|
|
|
*/ |
91
|
|
|
protected $address2 = ''; |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* @ORM\Column("address3") |
95
|
|
|
*/ |
96
|
|
|
protected $address3 = ''; |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* @ORM\Column("postal") |
100
|
|
|
*/ |
101
|
|
|
protected $postal = ''; |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* @ORM\Column("city") |
105
|
|
|
*/ |
106
|
|
|
protected $city = ''; |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* @ORM\Column("state") |
110
|
|
|
*/ |
111
|
|
|
protected $state = ''; |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* @ORM\Column("langid") |
115
|
|
|
*/ |
116
|
|
|
protected $langid; |
117
|
|
|
|
118
|
|
|
/** |
119
|
|
|
* @ORM\Column("countryid") |
120
|
|
|
*/ |
121
|
|
|
protected $countryid; |
122
|
|
|
|
123
|
|
|
/** |
124
|
|
|
* @ORM\Column("telephone") |
125
|
|
|
*/ |
126
|
|
|
protected $telephone = ''; |
127
|
|
|
|
128
|
|
|
/** |
129
|
|
|
* @ORM\Column("telefax") |
130
|
|
|
*/ |
131
|
|
|
protected $telefax = ''; |
132
|
|
|
|
133
|
|
|
/** |
134
|
|
|
* @ORM\Column("email") |
135
|
|
|
*/ |
136
|
|
|
protected $email = ''; |
137
|
|
|
|
138
|
|
|
/** |
139
|
|
|
* @ORM\Column("website") |
140
|
|
|
*/ |
141
|
|
|
protected $website = ''; |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* @ORM\Column("longitude") |
145
|
|
|
*/ |
146
|
|
|
protected $longitude; |
147
|
|
|
|
148
|
|
|
/** |
149
|
|
|
* @ORM\Column("latitude") |
150
|
|
|
*/ |
151
|
|
|
protected $latitude; |
152
|
|
|
|
153
|
|
|
/** |
154
|
|
|
* @ORM\Column("birthday") |
155
|
|
|
*/ |
156
|
|
|
protected $birthday; |
157
|
|
|
|
158
|
|
|
/** |
159
|
|
|
* @ORM\Column("vdate") |
160
|
|
|
*/ |
161
|
|
|
protected $vdate; |
162
|
|
|
|
163
|
|
|
/** |
164
|
|
|
* @ORM\Column("ctime") |
165
|
|
|
*/ |
166
|
|
|
protected $ctime; |
167
|
|
|
|
168
|
|
|
/** |
169
|
|
|
* @ORM\Column("mtime") |
170
|
|
|
*/ |
171
|
|
|
protected $mtime; |
172
|
|
|
|
173
|
|
|
/** |
174
|
|
|
* @ORM\Column("editor") |
175
|
|
|
*/ |
176
|
|
|
protected $editor = ''; |
177
|
|
|
|
178
|
|
|
|
179
|
|
|
public function getUserIdentifier() : string |
180
|
|
|
{ |
181
|
|
|
return $this->id ?? ''; |
182
|
|
|
} |
183
|
|
|
|
184
|
|
|
|
185
|
|
|
/** |
186
|
|
|
* @inheritDoc |
187
|
|
|
*/ |
188
|
|
|
public function getId() : ?string |
189
|
|
|
{ |
190
|
|
|
return $this->id; |
191
|
|
|
} |
192
|
|
|
|
193
|
|
|
|
194
|
|
|
/** |
195
|
|
|
* @inheritDoc |
196
|
|
|
*/ |
197
|
|
|
public function getUsername() : ?string |
198
|
|
|
{ |
199
|
|
|
return $this->username; |
200
|
|
|
} |
201
|
|
|
|
202
|
|
|
|
203
|
|
|
/** |
204
|
|
|
* @inheritDoc |
205
|
|
|
*/ |
206
|
|
|
public function getPassword() : ?string |
207
|
|
|
{ |
208
|
|
|
return $this->password; |
209
|
|
|
} |
210
|
|
|
|
211
|
|
|
|
212
|
|
|
/** |
213
|
|
|
* @inheritDoc |
214
|
|
|
*/ |
215
|
|
|
public function getRoles() : array |
216
|
|
|
{ |
217
|
|
|
return array( 'ROLE_USER' ); |
218
|
|
|
} |
219
|
|
|
|
220
|
|
|
|
221
|
|
|
/** |
222
|
|
|
* @inheritDoc |
223
|
|
|
*/ |
224
|
|
|
public function eraseCredentials() |
225
|
|
|
{ |
226
|
|
|
} |
227
|
|
|
|
228
|
|
|
|
229
|
|
|
public function __serialize() : array |
230
|
|
|
{ |
231
|
|
|
return array( |
232
|
|
|
'id' => $this->id, |
233
|
|
|
'username' => $this->username, |
234
|
|
|
'password' => $this->password, |
235
|
|
|
); |
236
|
|
|
} |
237
|
|
|
|
238
|
|
|
|
239
|
|
|
public function __unserialize( array $data ) : void |
240
|
|
|
{ |
241
|
|
|
$this->id = $data['id'] ?? null; |
242
|
|
|
$this->username = $data['username'] ?? null; |
243
|
|
|
$this->password = $data['password'] ?? null; |
244
|
|
|
} |
245
|
|
|
} |