We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 28acac6 commit 1767c8eCopy full SHA for 1767c8e
src/Security/SimpleIdentity.php
@@ -120,4 +120,22 @@ public function __isset(string $key): bool
120
{
121
return isset($this->data[$key]) || $this->parentIsSet($key);
122
}
123
+
124
125
+ public function __serialize(): array
126
+ {
127
+ return [
128
+ 'id' => $this->id,
129
+ 'roles' => $this->roles,
130
+ 'data' => $this->data,
131
+ ];
132
+ }
133
134
135
+ public function __unserialize(array $data): void
136
137
+ $this->id = $data['id'] ?? $data["\00Nette\\Security\\Identity\00id"] ?? 0;
138
+ $this->roles = $data['roles'] ?? $data["\00Nette\\Security\\Identity\00roles"] ?? [];
139
+ $this->data = $data['data'] ?? $data["\00Nette\\Security\\Identity\00data"] ?? [];
140
141
0 commit comments