Skip to content

Commit

Permalink
do not use deprecated execute statement
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Schiwon <[email protected]>
  • Loading branch information
blizzz committed Oct 11, 2022
1 parent ab194ab commit 66b5863
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/GroupBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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()) {
Expand Down Expand Up @@ -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()) {
Expand All @@ -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();

Expand Down Expand Up @@ -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()) {
Expand All @@ -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;
}
Expand All @@ -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());
Expand Down

0 comments on commit 66b5863

Please sign in to comment.