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 1818 * @author Ryan Weaver <weaverryan@gmail.com>
1919 * @author Javier Eguiluz <javier.eguiluz@gmail.com>
2020 */
21- class User implements UserInterface
21+ class User implements UserInterface, \Serializable
2222{
2323 /**
2424 * @var int
@@ -163,4 +163,28 @@ public function eraseCredentials()
163163 // if you had a plainPassword property, you'd nullify it here
164164 // $this->plainPassword = null;
165165 }
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+ }
166190}
You can’t perform that action at this time.
0 commit comments