Skip to content
Merged
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/CirclesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ function (Member $member): string {
// $circlesQueryHelper->addCircleDetails('test', 'shared_to');
//
// $items = [];
// $cursor = $qb->execute();
// $cursor = $qb->executeQuery();
// while ($row = $cursor->fetch()) {
// try {
// $items[] = [
Expand Down
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
6 changes: 3 additions & 3 deletions lib/Db/AccountsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function getAccountData(string $userId): array {

$this->limitToDBField($qb, 'uid', $userId);

$cursor = $qb->execute();
$cursor = $qb->executeQuery();
$data = $cursor->fetch();
$cursor->closeCursor();

Expand All @@ -46,7 +46,7 @@ public function getFromUserId(string $userId): array {

$this->limitToDBField($qb, 'uid', $userId);

$cursor = $qb->execute();
$cursor = $qb->executeQuery();
$data = $cursor->fetch();
$cursor->closeCursor();

Expand All @@ -66,7 +66,7 @@ public function getAll(): array {
$qb = $this->getAccountsSelectSql();

$accounts = [];
$cursor = $qb->execute();
$cursor = $qb->executeQuery();
while ($data = $cursor->fetch()) {
$account = $this->parseAccountsSelectSql($data);
$accounts[$account['userId']] = $account;
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 @@ -513,7 +513,7 @@ public function delete(Circle $circle): void {
$qb = $this->getCircleDeleteSql();
$qb->limitToUniqueId($circle->getSingleId());

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


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

$qb->execute();
$qb->executeStatement();
}
}
8 changes: 4 additions & 4 deletions lib/Db/CoreRequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public function cleanDatabase(bool $shares = false): void {
$qb = $this->getQueryBuilder();
try {
$qb->delete($table);
$qb->execute();
$qb->executeStatement();
} catch (Exception $e) {
}
}
Expand All @@ -254,7 +254,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 @@ -292,7 +292,7 @@ public function uninstallFromMigrations() {
$qb->limit('app', 'circles');
$qb->unlike('version', '001%');

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

/**
Expand All @@ -302,6 +302,6 @@ public function uninstallFromJobs() {
$qb = $this->getQueryBuilder();
// $qb->delete('jobs');
// $qb->where($this->exprLimitToDBField($qb, 'class', 'OCA\Circles\', true, true));
// $qb->execute();
// $qb->executeStatement();
}
}
14 changes: 9 additions & 5 deletions lib/Db/EventWrapperRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace OCA\Circles\Db;

use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
use OC\DB\Exceptions\DbalException;
use OCA\Circles\Model\Federated\EventWrapper;
use Psr\Log\LoggerInterface;

Expand Down Expand Up @@ -41,8 +41,12 @@ public function save(EventWrapper $wrapper): void {
->setValue('creation', $qb->createNamedParameter($wrapper->getCreation()));

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

$logger = \OCP\Server::get(LoggerInterface::class);
$logger->warning('issue while storing event', ['exception' => $e]);
}
Expand All @@ -60,7 +64,7 @@ public function update(EventWrapper $wrapper): void {
$qb->limitToInstance($wrapper->getInstance());
$qb->limitToToken($wrapper->getToken());

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


Expand All @@ -74,7 +78,7 @@ public function updateAll(string $token, int $status): void {

$qb->limitToToken($token);

$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
14 changes: 7 additions & 7 deletions lib/Db/GSSharesRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function create(GSShare $gsShare): void {
->setValue('parent', $qb->createNamedParameter($gsShare->getParent()))
->setValue('mountpoint', $qb->createNamedParameter($gsShare->getMountPoint()))
->setValue('mountpoint_hash', $qb->createNamedParameter($hash));
$qb->execute();
$qb->executeStatement();
}


Expand All @@ -54,7 +54,7 @@ public function getForUser(string $userId): array {
$this->leftJoinMountPoint($qb, $userId);

$shares = [];
$cursor = $qb->execute();
$cursor = $qb->executeQuery();
while ($data = $cursor->fetch()) {
$shares[] = $this->parseGSSharesSelectSql($data);
}
Expand All @@ -73,7 +73,7 @@ public function removeGSSharesFromMember(DeprecatedMember $member) {
$this->limitToInstance($qb, $member->getInstance());
$this->limitToOwner($qb, $member->getUserId());

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


Expand Down Expand Up @@ -126,7 +126,7 @@ public function getShareMountPointByPath(string $userId, string $target): GSShar
$this->limitToMountpointHash($qb, $targetHash);

$shares = [];
$cursor = $qb->execute();
$cursor = $qb->executeQuery();
$data = $cursor->fetch();

if ($data === false) {
Expand All @@ -151,7 +151,7 @@ public function getShareMountPointById(int $gsShareId, string $userId): GSShareM
$this->limitToUserId($qb, $userId);

$shares = [];
$cursor = $qb->execute();
$cursor = $qb->executeQuery();
$data = $cursor->fetch();
if ($data === false) {
throw new ShareNotFound();
Expand All @@ -173,7 +173,7 @@ public function generateShareMountPoint(GSShareMountpoint $mountpoint) {
->setValue('share_id', $qb->createNamedParameter($mountpoint->getShareId()))
->setValue('mountpoint', $qb->createNamedParameter($mountpoint->getMountPoint()))
->setValue('mountpoint_hash', $qb->createNamedParameter($hash));
$qb->execute();
$qb->executeStatement();
}


Expand All @@ -192,7 +192,7 @@ public function updateShareMountPoint(GSShareMountpoint $mountpoint) {

$this->limitToShareId($qb, $mountpoint->getShareId());
$this->limitToUserId($qb, $mountpoint->getUserId());
$nb = $qb->execute();
$nb = $qb->executeStatement();

return ($nb === 1);
}
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
Loading
Loading