|
@@ -286,4 +286,29 @@ class User extends Data
|
|
|
|
|
|
return 'https://www.gravatar.com/avatar/' . md5($this->email);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ * Serialize user.
|
|
|
+ */
|
|
|
+ public function __sleep()
|
|
|
+ {
|
|
|
+ return [
|
|
|
+ 'items',
|
|
|
+ 'storage'
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * Unserialize user.
|
|
|
+ */
|
|
|
+ public function __wakeup()
|
|
|
+ {
|
|
|
+ $this->gettersVariable = 'items';
|
|
|
+ $this->nestedSeparator = '.';
|
|
|
+
|
|
|
+ if (null === $this->blueprints) {
|
|
|
+ $blueprints = new Blueprints;
|
|
|
+ $this->blueprints = $blueprints->get('user/account');
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|