summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2021-03-11 15:39:42 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2021-03-11 15:39:42 +0100
commit8008b33b8dd52dcdcc834d4f60783fa3999b2b60 (patch)
tree44140e157b55bb7b3cb3cd47f263e6691d8d4e6d /apps/files_trashbin
parent69c4578b5bdd54a53ae5467fc656af3aed2afb58 (diff)
downloadnextcloud-server-8008b33b8dd52dcdcc834d4f60783fa3999b2b60.tar.gz
nextcloud-server-8008b33b8dd52dcdcc834d4f60783fa3999b2b60.zip
Cleanp execute usage in the trashbin
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r--apps/files_trashbin/lib/Trashbin.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php
index 7a7307ab470..537f774efaa 100644
--- a/apps/files_trashbin/lib/Trashbin.php
+++ b/apps/files_trashbin/lib/Trashbin.php
@@ -133,7 +133,7 @@ class Trashbin {
$query->select('id', 'timestamp', 'location')
->from('files_trash')
->where($query->expr()->eq('user', $query->createNamedParameter($user)));
- $result = $query->execute();
+ $result = $query->executeQuery();
$array = [];
while ($row = $result->fetch()) {
if (isset($array[$row['id']])) {
@@ -162,7 +162,7 @@ class Trashbin {
->andWhere($query->expr()->eq('id', $query->createNamedParameter($filename)))
->andWhere($query->expr()->eq('timestamp', $query->createNamedParameter($timestamp)));
- $result = $query->execute();
+ $result = $query->executeQuery();
$row = $result->fetch();
$result->closeCursor();
@@ -226,7 +226,7 @@ class Trashbin {
->setValue('timestamp', $query->createNamedParameter($timestamp))
->setValue('location', $query->createNamedParameter($targetLocation))
->setValue('user', $query->createNamedParameter($user));
- $result = $query->execute();
+ $result = $query->executeUpdate();
if (!$result) {
\OC::$server->getLogger()->error('trash bin database couldn\'t be updated for the files owner', ['app' => 'files_trashbin']);
}
@@ -353,7 +353,7 @@ class Trashbin {
->setValue('timestamp', $query->createNamedParameter($timestamp))
->setValue('location', $query->createNamedParameter($location))
->setValue('user', $query->createNamedParameter($owner));
- $result = $query->execute();
+ $result = $query->executeUpdate();
if (!$result) {
\OC::$server->getLogger()->error('trash bin database couldn\'t be updated', ['app' => 'files_trashbin']);
}
@@ -516,7 +516,7 @@ class Trashbin {
->where($query->expr()->eq('user', $query->createNamedParameter($user)))
->andWhere($query->expr()->eq('id', $query->createNamedParameter($filename)))
->andWhere($query->expr()->eq('timestamp', $query->createNamedParameter($timestamp)));
- $query->execute();
+ $query->executeUpdate();
}
return true;
@@ -606,7 +606,7 @@ class Trashbin {
$query = \OC::$server->getDatabaseConnection()->getQueryBuilder();
$query->delete('files_trash')
->where($query->expr()->eq('user', $query->createNamedParameter($user)));
- $query->execute();
+ $query->executeUpdate();
// Bulk PostDelete-Hook
\OC_Hook::emit('\OCP\Trashbin', 'deleteAll', ['paths' => $filePaths]);
@@ -660,7 +660,7 @@ class Trashbin {
->where($query->expr()->eq('user', $query->createNamedParameter($user)))
->andWhere($query->expr()->eq('id', $query->createNamedParameter($filename)))
->andWhere($query->expr()->eq('timestamp', $query->createNamedParameter($timestamp)));
- $query->execute();
+ $query->executeUpdate();
$file = $filename . '.d' . $timestamp;
} else {
@@ -746,7 +746,7 @@ class Trashbin {
$query = \OC::$server->getDatabaseConnection()->getQueryBuilder();
$query->delete('files_trash')
->where($query->expr()->eq('user', $query->createNamedParameter($uid)));
- return (bool) $query->execute();
+ return (bool) $query->executeUpdate();
}
/**
@@ -1003,7 +1003,7 @@ class Trashbin {
->andWhere($query->expr()->eq('parent', $query->createNamedParameter($parentId)))
->andWhere($query->expr()->iLike('name', $query->createNamedParameter($pattern)));
- $result = $query->execute();
+ $result = $query->executeQuery();
$entries = $result->fetchAll();
$result->closeCursor();