diff --git a/lib/GroupBackend.php b/lib/GroupBackend.php index 11f915139..9ffe220ef 100644 --- a/lib/GroupBackend.php +++ b/lib/GroupBackend.php @@ -61,7 +61,7 @@ public function inGroup($uid, $gid): bool { ->where($qb->expr()->eq('uid', $qb->createNamedParameter($uid))) ->andWhere($qb->expr()->eq('gid', $qb->createNamedParameter($gid))) ->setMaxResults(1) - ->execute(); + ->executeQuery(); $result = count($stmt->fetchAll()) > 0; $stmt->closeCursor(); @@ -76,7 +76,7 @@ public function getUserGroups($uid): array { $cursor = $qb->select('gid') ->from(self::TABLE_MEMBERS) ->where($qb->expr()->eq('uid', $qb->createNamedParameter($uid))) - ->execute(); + ->executeQuery(); $groups = []; while ($row = $cursor->fetch()) { @@ -105,7 +105,7 @@ public function getGroups($search = '', $limit = null, $offset = null): array { $query->setMaxResults($limit) ->setFirstResult($offset); - $result = $query->execute(); + $result = $query->executeQuery(); $groups = []; while ($row = $result->fetch()) { @@ -129,7 +129,7 @@ public function groupExists($gid): bool { $cursor = $qb->select('gid') ->from(self::TABLE_GROUPS) ->where($qb->expr()->eq('gid', $qb->createNamedParameter($gid))) - ->execute(); + ->executeQuery(); $result = $cursor->fetch(); $cursor->closeCursor(); @@ -182,7 +182,7 @@ public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0): arra $query->setFirstResult($offset); } - $result = $query->execute(); + $result = $query->executeQuery(); $users = []; while ($row = $result->fetch()) { @@ -203,7 +203,7 @@ public function createGroup(string $gid, string $samlGid = null): bool { ->setValue('gid', $builder->createNamedParameter($gid)) ->setValue('displayname', $builder->createNamedParameter($displayName)) ->setValue('saml_gid', $builder->createNamedParameter($samlGid)) - ->execute(); + ->executeStatement(); } catch (UniqueConstraintViolationException $e) { $result = 0; } @@ -220,7 +220,7 @@ public function addToGroup(string $uid, string $gid): bool { $qb->insert(self::TABLE_MEMBERS) ->setValue('uid', $qb->createNamedParameter($uid)) ->setValue('gid', $qb->createNamedParameter($gid)) - ->execute(); + ->executeStatement(); return true; } catch (\Exception $e) { throw new AddUserToGroupException($e->getMessage());