mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
feat: yield user by id in IUserManager::getSeenUsers
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
c80c980e29
commit
765d1af2a6
2 changed files with 4 additions and 2 deletions
|
|
@ -826,7 +826,7 @@ class Manager extends PublicEmitter implements IUserManager {
|
|||
foreach ($this->backends as $backend) {
|
||||
if ($backend->userExists($userId)) {
|
||||
$user = new LazyUser($userId, $this, null, $backend);
|
||||
yield $user;
|
||||
yield $userId => $user;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -240,9 +240,11 @@ interface IUserManager {
|
|||
* An iterator is returned allowing the caller to stop the iteration at any time.
|
||||
* The offset argument allows the caller to continue the iteration at a specific offset.
|
||||
*
|
||||
* @since 33.0.0 users are yielded with the user id as key
|
||||
*
|
||||
* @param int $offset from which offset to fetch
|
||||
* @param int|null $limit maximum number of records to fetch
|
||||
* @return \Iterator<IUser> list of IUser object
|
||||
* @return \Iterator<string, IUser> list of IUser object
|
||||
* @since 32.0.0
|
||||
*/
|
||||
public function getSeenUsers(int $offset = 0, ?int $limit = null): \Iterator;
|
||||
|
|
|
|||
Loading…
Reference in a new issue