Skip to content

Commit e9ccbd9

Browse files
committed
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>
1 parent 05360d8 commit e9ccbd9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/Backend/UserBackend.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,18 @@ public function getUsers($search = "", $limit = null, $offset = null, $callback
459459
"Returning from cache getUsers($search, $limit, $offset): count("
460460
. count($users) . ")", ["app" => $this->appName]
461461
);
462+
// convert to user-model
463+
foreach ($users as $index => $cachedUser) {
464+
if (!is_array($cachedUser)) {
465+
break;
466+
}
467+
$user = new User();
468+
foreach ($cachedUser as $key => $value) {
469+
$user->{$key} = $value;
470+
}
471+
$users[$index] = $user;
472+
}
473+
462474
return $users;
463475
}
464476

0 commit comments

Comments
 (0)