File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change 18
18
* @author Ryan Weaver <[email protected] >
19
19
* @author Javier Eguiluz <[email protected] >
20
20
*/
21
- class User implements UserInterface
21
+ class User implements UserInterface, \Serializable
22
22
{
23
23
/**
24
24
* @var int
@@ -163,4 +163,28 @@ public function eraseCredentials()
163
163
// if you had a plainPassword property, you'd nullify it here
164
164
// $this->plainPassword = null;
165
165
}
166
+
167
+ /** @see \Serializable::serialize() */
168
+ public function serialize ()
169
+ {
170
+ return serialize ([
171
+ $ this ->id ,
172
+ $ this ->username ,
173
+ $ this ->password ,
174
+ // see section on salt below
175
+ // $this->salt,
176
+ ]);
177
+ }
178
+
179
+ /** @see \Serializable::unserialize() */
180
+ public function unserialize ($ serialized )
181
+ {
182
+ list (
183
+ $ this ->id ,
184
+ $ this ->username ,
185
+ $ this ->password ,
186
+ // see section on salt below
187
+ // $this->salt
188
+ ) = unserialize ($ serialized );
189
+ }
166
190
}
You can’t perform that action at this time.
0 commit comments