diff options
Diffstat (limited to 'lib/private/Group/Database.php')
-rw-r--r-- | lib/private/Group/Database.php | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/lib/private/Group/Database.php b/lib/private/Group/Database.php index 72cd0ea4a91..095cbe24316 100644 --- a/lib/private/Group/Database.php +++ b/lib/private/Group/Database.php @@ -44,15 +44,15 @@ class Database extends ABackend implements INamedBackend { /** @var array<string, array{gid: string, displayname: string}> */ private $groupCache = []; - private ?IDBConnection $dbConn; /** * \OC\Group\Database constructor. * * @param IDBConnection|null $dbConn */ - public function __construct(?IDBConnection $dbConn = null) { - $this->dbConn = $dbConn; + public function __construct( + private ?IDBConnection $dbConn = null, + ) { } /** @@ -102,19 +102,19 @@ class Database extends ABackend implements $qb = $this->dbConn->getQueryBuilder(); $qb->delete('groups') ->where($qb->expr()->eq('gid', $qb->createNamedParameter($gid))) - ->execute(); + ->executeStatement(); // Delete the group-user relation $qb = $this->dbConn->getQueryBuilder(); $qb->delete('group_user') ->where($qb->expr()->eq('gid', $qb->createNamedParameter($gid))) - ->execute(); + ->executeStatement(); // Delete the group-groupadmin relation $qb = $this->dbConn->getQueryBuilder(); $qb->delete('group_admin') ->where($qb->expr()->eq('gid', $qb->createNamedParameter($gid))) - ->execute(); + ->executeStatement(); // Delete from cache unset($this->groupCache[$gid]); @@ -139,7 +139,7 @@ class Database extends ABackend implements ->from('group_user') ->where($qb->expr()->eq('gid', $qb->createNamedParameter($gid))) ->andWhere($qb->expr()->eq('uid', $qb->createNamedParameter($uid))) - ->execute(); + ->executeQuery(); $result = $cursor->fetch(); $cursor->closeCursor(); @@ -164,7 +164,7 @@ class Database extends ABackend implements $qb->insert('group_user') ->setValue('uid', $qb->createNamedParameter($uid)) ->setValue('gid', $qb->createNamedParameter($gid)) - ->execute(); + ->executeStatement(); return true; } else { return false; @@ -186,7 +186,7 @@ class Database extends ABackend implements $qb->delete('group_user') ->where($qb->expr()->eq('uid', $qb->createNamedParameter($uid))) ->andWhere($qb->expr()->eq('gid', $qb->createNamedParameter($gid))) - ->execute(); + ->executeStatement(); return true; } @@ -213,7 +213,7 @@ class Database extends ABackend implements ->from('group_user', 'gu') ->leftJoin('gu', 'groups', 'g', $qb->expr()->eq('gu.gid', 'g.gid')) ->where($qb->expr()->eq('uid', $qb->createNamedParameter($uid))) - ->execute(); + ->executeQuery(); $groups = []; while ($row = $cursor->fetch()) { @@ -260,7 +260,7 @@ class Database extends ABackend implements if ($offset > 0) { $query->setFirstResult($offset); } - $result = $query->execute(); + $result = $query->executeQuery(); $groups = []; while ($row = $result->fetch()) { @@ -292,7 +292,7 @@ class Database extends ABackend implements $cursor = $qb->select('gid', 'displayname') ->from('groups') ->where($qb->expr()->eq('gid', $qb->createNamedParameter($gid))) - ->execute(); + ->executeQuery(); $result = $cursor->fetch(); $cursor->closeCursor(); @@ -423,7 +423,7 @@ class Database extends ABackend implements ))); } - $result = $query->execute(); + $result = $query->executeQuery(); $count = $result->fetchOne(); $result->closeCursor(); @@ -455,7 +455,7 @@ class Database extends ABackend implements ->andWhere($query->expr()->eq('configvalue', $query->createNamedParameter('false'), IQueryBuilder::PARAM_STR)) ->andWhere($query->expr()->eq('gid', $query->createNamedParameter($gid), IQueryBuilder::PARAM_STR)); - $result = $query->execute(); + $result = $query->executeQuery(); $count = $result->fetchOne(); $result->closeCursor(); @@ -484,7 +484,7 @@ class Database extends ABackend implements ->from('groups') ->where($query->expr()->eq('gid', $query->createNamedParameter($gid))); - $result = $query->execute(); + $result = $query->executeQuery(); $displayName = $result->fetchOne(); $result->closeCursor(); @@ -555,7 +555,7 @@ class Database extends ABackend implements $query->update('groups') ->set('displayname', $query->createNamedParameter($displayName)) ->where($query->expr()->eq('gid', $query->createNamedParameter($gid))); - $query->execute(); + $query->executeStatement(); return true; } |