aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/Service/DBConfigService.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/lib/Service/DBConfigService.php')
-rw-r--r--apps/files_external/lib/Service/DBConfigService.php49
1 files changed, 17 insertions, 32 deletions
diff --git a/apps/files_external/lib/Service/DBConfigService.php b/apps/files_external/lib/Service/DBConfigService.php
index 6fb7e01271e..3820f6b0d96 100644
--- a/apps/files_external/lib/Service/DBConfigService.php
+++ b/apps/files_external/lib/Service/DBConfigService.php
@@ -24,25 +24,10 @@ class DBConfigService {
public const APPLICABLE_TYPE_GROUP = 2;
public const APPLICABLE_TYPE_USER = 3;
- /**
- * @var IDBConnection
- */
- private $connection;
-
- /**
- * @var ICrypto
- */
- private $crypto;
-
- /**
- * DBConfigService constructor.
- *
- * @param IDBConnection $connection
- * @param ICrypto $crypto
- */
- public function __construct(IDBConnection $connection, ICrypto $crypto) {
- $this->connection = $connection;
- $this->crypto = $crypto;
+ public function __construct(
+ private IDBConnection $connection,
+ private ICrypto $crypto,
+ ) {
}
public function getMountById(int $mountId): ?array {
@@ -112,7 +97,7 @@ class DBConfigService {
)
)
->groupBy(['a.mount_id']);
- $stmt = $query->execute();
+ $stmt = $query->executeQuery();
$result = $stmt->fetchAll();
$stmt->closeCursor();
@@ -243,7 +228,7 @@ class DBConfigService {
'priority' => $builder->createNamedParameter($priority, IQueryBuilder::PARAM_INT),
'type' => $builder->createNamedParameter($type, IQueryBuilder::PARAM_INT)
]);
- $query->execute();
+ $query->executeStatement();
return $query->getLastInsertId();
}
@@ -256,22 +241,22 @@ class DBConfigService {
$builder = $this->connection->getQueryBuilder();
$query = $builder->delete('external_mounts')
->where($builder->expr()->eq('mount_id', $builder->createNamedParameter($mountId, IQueryBuilder::PARAM_INT)));
- $query->execute();
+ $query->executeStatement();
$builder = $this->connection->getQueryBuilder();
$query = $builder->delete('external_applicable')
->where($builder->expr()->eq('mount_id', $builder->createNamedParameter($mountId, IQueryBuilder::PARAM_INT)));
- $query->execute();
+ $query->executeStatement();
$builder = $this->connection->getQueryBuilder();
$query = $builder->delete('external_config')
->where($builder->expr()->eq('mount_id', $builder->createNamedParameter($mountId, IQueryBuilder::PARAM_INT)));
- $query->execute();
+ $query->executeStatement();
$builder = $this->connection->getQueryBuilder();
$query = $builder->delete('external_options')
->where($builder->expr()->eq('mount_id', $builder->createNamedParameter($mountId, IQueryBuilder::PARAM_INT)));
- $query->execute();
+ $query->executeStatement();
}
/**
@@ -285,7 +270,7 @@ class DBConfigService {
->set('mount_point', $builder->createNamedParameter($newMountPoint))
->where($builder->expr()->eq('mount_id', $builder->createNamedParameter($mountId, IQueryBuilder::PARAM_INT)));
- $query->execute();
+ $query->executeStatement();
}
/**
@@ -299,7 +284,7 @@ class DBConfigService {
->set('auth_backend', $builder->createNamedParameter($newAuthBackend))
->where($builder->expr()->eq('mount_id', $builder->createNamedParameter($mountId, IQueryBuilder::PARAM_INT)));
- $query->execute();
+ $query->executeStatement();
}
/**
@@ -325,7 +310,7 @@ class DBConfigService {
->set('value', $builder->createNamedParameter($value, IQueryBuilder::PARAM_STR))
->where($builder->expr()->eq('mount_id', $builder->createNamedParameter($mountId, IQueryBuilder::PARAM_INT)))
->andWhere($builder->expr()->eq('key', $builder->createNamedParameter($key, IQueryBuilder::PARAM_STR)));
- $query->execute();
+ $query->executeStatement();
}
}
@@ -348,7 +333,7 @@ class DBConfigService {
->set('value', $builder->createNamedParameter(json_encode($value), IQueryBuilder::PARAM_STR))
->where($builder->expr()->eq('mount_id', $builder->createNamedParameter($mountId, IQueryBuilder::PARAM_INT)))
->andWhere($builder->expr()->eq('key', $builder->createNamedParameter($key, IQueryBuilder::PARAM_STR)));
- $query->execute();
+ $query->executeStatement();
}
}
@@ -377,11 +362,11 @@ class DBConfigService {
$query = $query->andWhere($builder->expr()->eq('value', $builder->createNamedParameter($value, IQueryBuilder::PARAM_STR)));
}
- $query->execute();
+ $query->executeStatement();
}
private function getMountsFromQuery(IQueryBuilder $query) {
- $result = $query->execute();
+ $result = $query->executeQuery();
$mounts = $result->fetchAll();
$uniqueMounts = [];
foreach ($mounts as $mount) {
@@ -432,7 +417,7 @@ class DBConfigService {
->from($table)
->where($builder->expr()->in('mount_id', $placeHolders));
- $result = $query->execute();
+ $result = $query->executeQuery();
$rows = $result->fetchAll();
$result->closeCursor();