UserBackend: users fetched from the cache have to be converted back from an array representation to the User-object.

Signed-off-by: Claus-Justus Heine <himself@claus-justus-heine.de>
This commit is contained in:
Claus-Justus Heine
2023-01-30 18:25:43 +01:00
parent 05360d8aa2
commit e9ccbd95d6

View File

@@ -459,6 +459,18 @@ final class UserBackend extends ABackend implements
"Returning from cache getUsers($search, $limit, $offset): count("
. count($users) . ")", ["app" => $this->appName]
);
// convert to user-model
foreach ($users as $index => $cachedUser) {
if (!is_array($cachedUser)) {
break;
}
$user = new User();
foreach ($cachedUser as $key => $value) {
$user->{$key} = $value;
}
$users[$index] = $user;
}
return $users;
}