Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Command/MigrateCustomGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ private function getSharedIds(string $groupUri): array {
->where($select->expr()->eq('share_type', $select->createNamedParameter(IShare::TYPE_GROUP)));

$shareIds = [];
$result = $select->execute();
$result = $select->executeQuery();
while ($row = $result->fetch()) {
$with = $row['share_with'];
if (!str_starts_with($with, 'customgroup_')
Expand Down
16 changes: 8 additions & 8 deletions lib/Db/CircleRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function save(Circle $circle): void {
->setValue('settings', $qb->createNamedParameter(json_encode($circle->getSettings())))
->setValue('config', $qb->createNamedParameter($circle->getConfig()));

$qb->execute();
$qb->executeStatement();
}


Expand All @@ -67,7 +67,7 @@ public function edit(Circle $circle): void {

$qb->limitToUniqueId($circle->getSingleId());

$qb->execute();
$qb->executeStatement();
}

/**
Expand All @@ -83,7 +83,7 @@ public function update(Circle $circle) {

$qb->limitToUniqueId($circle->getSingleId());

$qb->execute();
$qb->executeStatement();
}


Expand Down Expand Up @@ -112,7 +112,7 @@ public function updateDisplayName(string $singleId, string $displayName): void {

$qb->limitToUniqueId($singleId);

$qb->execute();
$qb->executeStatement();
}


Expand All @@ -125,7 +125,7 @@ public function updateConfig(Circle $circle) {

$qb->limitToUniqueId($circle->getSingleId());

$qb->execute();
$qb->executeStatement();
}


Expand All @@ -137,7 +137,7 @@ public function updateSettings(Circle $circle) {
$qb->set('settings', $qb->createNamedParameter(json_encode($circle->getSettings())));
$qb->limitToUniqueId($circle->getSingleId());

$qb->execute();
$qb->executeStatement();
}


Expand Down Expand Up @@ -483,7 +483,7 @@ public function delete(Circle $circle): void {
$qb = $this->getCircleDeleteSql();
$qb->limitToUniqueId($circle->getSingleId());

$qb->execute();
$qb->executeStatement();
}


Expand All @@ -494,6 +494,6 @@ public function deleteFederatedUser(IFederatedUser $federatedUser): void {
$qb = $this->getCircleDeleteSql();
$qb->limitToUniqueId($federatedUser->getSingleId());

$qb->execute();
$qb->executeStatement();
}
}
6 changes: 3 additions & 3 deletions lib/Db/CoreRequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public function cleanDatabase(bool $shares = false): void {
$qb = $this->getQueryBuilder();
try {
$qb->delete($table);
$qb->execute();
$qb->executeStatement();
} catch (Exception $e) {
}
}
Expand All @@ -252,7 +252,7 @@ public function cleanDatabase(bool $shares = false): void {
$expr = $qb->expr();
$qb->delete(self::TABLE_SHARE);
$qb->where($expr->eq('share_type', $qb->createNamedParameter(IShare::TYPE_CIRCLE)));
$qb->execute();
$qb->executeStatement();
}
}

Expand Down Expand Up @@ -290,7 +290,7 @@ public function uninstallFromMigrations() {
$qb->limit('app', 'circles');
$qb->unlike('version', '001%');

$qb->execute();
$qb->executeStatement();
}

/**
Expand Down
8 changes: 4 additions & 4 deletions lib/Db/FileSharesRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function removeSharesFromMember(DeprecatedMember $member): void {
$expr->eq('uid_initiator', $qb->createNamedParameter($member->getUserId())),
));

$qb->execute();
$qb->executeStatement();
}


Expand All @@ -48,7 +48,7 @@ public function removeSharesToCircleId(string $circleId): void {
$expr->eq('share_with', $qb->createNamedParameter($circleId)),
));

$qb->execute();
$qb->executeStatement();
}


Expand All @@ -64,7 +64,7 @@ public function getSharesForCircle(string $circleId): array {
$this->limitToShareType($qb, self::SHARE_TYPE);

$shares = [];
$cursor = $qb->execute();
$cursor = $qb->executeQuery();
while ($data = $cursor->fetch()) {
$shares[] = $data;
}
Expand All @@ -86,7 +86,7 @@ public function getShares(): array {
$qb->andWhere($expr->isNull($this->default_select_alias . '.parent'));

$shares = [];
$cursor = $qb->execute();
$cursor = $qb->executeQuery();
while ($data = $cursor->fetch()) {
$shares[] = $data;
}
Expand Down
16 changes: 8 additions & 8 deletions lib/Db/MemberRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function save(Member $member): void {
$qb->setValue('invited_by', $qb->createNamedParameter($member->getInvitedBy()->getSingleId()));
}

$qb->execute();
$qb->executeStatement();
}


Expand All @@ -77,7 +77,7 @@ public function update(Member $member): void {
$qb->limitToCircleId($member->getCircleId());
$qb->limitToSingleId($member->getSingleId());

$qb->execute();
$qb->executeStatement();
}


Expand Down Expand Up @@ -112,7 +112,7 @@ public function updateDisplayName(string $singleId, string $displayName, string
$qb->limitToCircleId($circleId);
}

$qb->execute();
$qb->executeStatement();
}


Expand All @@ -124,7 +124,7 @@ public function delete(Member $member) {
$qb->limitToCircleId($member->getCircleId());
$qb->limitToSingleId($member->getSingleId());

$qb->execute();
$qb->executeStatement();
}


Expand All @@ -137,7 +137,7 @@ public function deleteFederatedUser(IFederatedUser $federatedUser): void {
$qb->limitToMemberId($federatedUser->getSingleId());
$qb->limitToCircleId($federatedUser->getSingleId());

$qb->execute();
$qb->executeStatement();
}


Expand All @@ -150,7 +150,7 @@ public function deleteFederatedUserFromCircle(IFederatedUser $federatedUser, Cir
$qb->limitToSingleId($federatedUser->getSingleId());
$qb->limitToCircleId($circle->getSingleId());

$qb->execute();
$qb->executeStatement();
}


Expand All @@ -167,7 +167,7 @@ public function deleteAllFromCircle(Circle $circle) {
)
);

$qb->execute();
$qb->executeStatement();
}


Expand All @@ -182,7 +182,7 @@ public function updateLevel(Member $member): void {
$qb->limitToCircleId($member->getCircleId());
$qb->limitToSingleId($member->getSingleId());

$qb->execute();
$qb->executeStatement();
}


Expand Down
14 changes: 7 additions & 7 deletions lib/Db/RemoteRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function save(RemoteInstance $remote): void {
->setValue('interface', $qb->createNamedParameter($remote->getInterface()))
->setValue('item', $qb->createNamedParameter(json_encode($remote->getOrigData())));

$qb->execute();
$qb->executeStatement();
}


Expand All @@ -59,7 +59,7 @@ public function update(RemoteInstance $remote) {

$qb->limitToInstance($remote->getInstance());

$qb->execute();
$qb->executeStatement();
}


Expand All @@ -75,7 +75,7 @@ public function updateItem(RemoteInstance $remote) {

$qb->limit('uid', $remote->getUid(true), '', false);

$qb->execute();
$qb->executeStatement();
}


Expand All @@ -91,7 +91,7 @@ public function updateInstance(RemoteInstance $remote) {

$qb->limit('uid', $remote->getUid(true), '', false);

$qb->execute();
$qb->executeStatement();
}


Expand All @@ -107,7 +107,7 @@ public function updateType(RemoteInstance $remote) {

$qb->limit('uid', $remote->getUid(true), '', false);

$qb->execute();
$qb->executeStatement();
}


Expand All @@ -123,7 +123,7 @@ public function updateHref(RemoteInstance $remote) {

$qb->limit('uid', $remote->getUid(true), '', false);

$qb->execute();
$qb->executeStatement();
}


Expand Down Expand Up @@ -259,6 +259,6 @@ public function searchDuplicate(RemoteInstance $remoteInstance): RemoteInstance
public function deleteById(RemoteInstance $remoteInstance) {
$qb = $this->getRemoteDeleteSql();
$qb->limitToId($remoteInstance->getDbId());
$qb->execute();
$qb->executeStatement();
}
}
20 changes: 12 additions & 8 deletions lib/Db/TokensRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use OCA\Circles\Exceptions\TokenDoesNotExistException;
use OCA\Circles\Model\DeprecatedMember;
use OCA\Circles\Model\SharesToken;
use OCP\DB\Exception;
use OCP\Security\IHasher;
use OCP\Server;

Expand All @@ -32,7 +33,7 @@ public function getByToken(string $token) {
$qb = $this->getTokensSelectSql();
$this->limitToToken($qb, $token);

$cursor = $qb->execute();
$cursor = $qb->executeQuery();
$data = $cursor->fetch();
$cursor->closeCursor();
if ($data === false) {
Expand All @@ -57,7 +58,7 @@ public function getTokenFromMember(string $shareId, string $circleId, string $em
$this->limitToUserId($qb, $email);
$this->limitToCircleId($qb, $circleId);

$cursor = $qb->execute();
$cursor = $qb->executeQuery();
$data = $cursor->fetch();
$cursor->closeCursor();
if ($data === false) {
Expand All @@ -79,7 +80,7 @@ public function getTokensFromMember(DeprecatedMember $member) {
$this->limitToCircleId($qb, $member->getCircleId());

$shares = [];
$cursor = $qb->execute();
$cursor = $qb->executeQuery();
while ($data = $cursor->fetch()) {
$shares[] = $this->parseTokensSelectSql($data);
}
Expand Down Expand Up @@ -114,8 +115,11 @@ public function generateTokenForMember(DeprecatedMember $member, int $shareId, s
->setValue('token', $qb->createNamedParameter($token))
->setValue('password', $qb->createNamedParameter($password));

$qb->execute();
} catch (UniqueConstraintViolationException $e) {
$qb->executeStatement();
} catch (Exception $e) {
if ($e->getReason() !== Exception::REASON_CONSTRAINT_VIOLATION) {
throw $e;
}
}

return $this->getTokenFromMember($shareId, $member->getCircleId(), $member->getUserId());
Expand All @@ -129,7 +133,7 @@ public function removeTokenByShareId(int $shareId) {
$qb = $this->getTokensDeleteSql();
$this->limitToShareId($qb, $shareId);

$qb->execute();
$qb->executeStatement();
}


Expand All @@ -141,7 +145,7 @@ public function removeTokensFromMember(DeprecatedMember $member) {
$this->limitToCircleId($qb, $member->getCircleId());
$this->limitToUserId($qb, $member->getUserId());

$qb->execute();
$qb->executeStatement();
}


Expand All @@ -156,6 +160,6 @@ public function updateSinglePassword(string $circleId, string $password) {
$this->limitToCircleId($qb, $circleId);
$qb->set('password', $qb->createNamedParameter($password));

$qb->execute();
$qb->executeStatement();
}
}
4 changes: 2 additions & 2 deletions lib/Tools/Db/ExtendedQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ private function parseSimpleSelectSql(
* @throws RowNotFoundException
*/
public function getRow(callable $method, string $object = '', array $params = []): IQueryRow {
$cursor = $this->execute();
$cursor = $this->executeQuery();
$data = $cursor->fetch();
$cursor->closeCursor();

Expand All @@ -1016,7 +1016,7 @@ public function getRow(callable $method, string $object = '', array $params = []
*/
public function getRows(callable $method, string $object = '', array $params = []): array {
$rows = [];
$cursor = $this->execute();
$cursor = $this->executeQuery();
while ($data = $cursor->fetch()) {
try {
$rows[] = $method($data, $this, $object, $params);
Expand Down
Loading