Skip to content

Commit a3d97f1

Browse files
committed
fix: serialize pfp image
1 parent 977e62b commit a3d97f1

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/Entity/User.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,20 @@ public function setGoogleActivationSecret(string|null $googleActivationSecret):
158158
{
159159
$this->googleActivationSecret = $googleActivationSecret;
160160
}
161+
162+
public function __serialize(): array
163+
{
164+
$vars = get_object_vars($this);
165+
unset($vars['imageFile']);
166+
return $vars;
167+
}
168+
169+
public function __unserialize(array $data): void
170+
{
171+
foreach ($data as $key => $value) {
172+
if (property_exists($this, $key)) {
173+
$this->$key = $value;
174+
}
175+
}
176+
}
161177
}

0 commit comments

Comments
 (0)