Browse Source

Fix DB usersInGroups fetching

* Follow the interface defaults
* Only set limit or offset if they are properly set

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
tags/v18.0.0beta1
Roeland Jago Douma 4 years ago
parent
commit
6db51324fa
No account linked to committer's email address
1 changed files with 8 additions and 3 deletions
  1. 8
    3
      lib/private/Group/Database.php

+ 8
- 3
lib/private/Group/Database.php View File

* @param int $offset * @param int $offset
* @return array an array of user ids * @return array an array of user ids
*/ */
public function usersInGroup($gid, $search = '', $limit = null, $offset = null) {
public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) {
$this->fixDI(); $this->fixDI();


$query = $this->dbConn->getQueryBuilder(); $query = $this->dbConn->getQueryBuilder();
))); )));
} }


$query->setMaxResults($limit)
->setFirstResult($offset);
if ($limit !== -1) {
$query->setMaxResults($limit);
}
if ($offset !== 0) {
$query->setFirstResult($offset);
}

$result = $query->execute(); $result = $query->execute();


$users = []; $users = [];

Loading…
Cancel
Save