]> source.dussan.org Git - nextcloud-server.git/commitdiff
also update groupinterface and database backend
authorRobin Appelman <robin@icewind.nl>
Wed, 8 Feb 2023 10:46:37 +0000 (11:46 +0100)
committerRobin Appelman <robin@icewind.nl>
Thu, 11 May 2023 15:30:03 +0000 (17:30 +0200)
Signed-off-by: Robin Appelman <robin@icewind.nl>
lib/private/Group/Database.php
lib/public/GroupInterface.php

index 569cfa5007f345cf6595889fd9609abf724b2866..edfc76ef836e6736ce162bf490ddec28eea3dd32 100644 (file)
@@ -266,7 +266,7 @@ class Database extends ABackend implements
         *
         * Returns a list with all groups
         */
-       public function getGroups($search = '', $limit = null, $offset = null) {
+       public function getGroups(string $search = '', int $limit = -1, int $offset = 0) {
                $this->fixDI();
 
                $query = $this->dbConn->getQueryBuilder();
@@ -283,8 +283,12 @@ class Database extends ABackend implements
                        )));
                }
 
-               $query->setMaxResults($limit)
-                       ->setFirstResult($offset);
+               if (!$limit > 0) {
+                       $query->setMaxResults($limit);
+               }
+               if ($offset > 0) {
+                       $query->setFirstResult($offset);
+               }
                $result = $query->execute();
 
                $groups = [];
index 56863100c05041b359a7f2369d20c7bc0d10eecc..a18d38df0022ebdd32a534e11e59f11a9e6d924a 100644 (file)
@@ -95,7 +95,7 @@ interface GroupInterface {
         *
         * Returns a list with all groups
         */
-       public function getGroups($search = '', $limit = -1, $offset = 0);
+       public function getGroups(string $search = '', int $limit = -1, int $offset = 0);
 
        /**
         * check if a group exists