diff options
author | Robin Appelman <robin@icewind.nl> | 2024-07-04 19:20:46 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2024-07-12 17:01:39 +0200 |
commit | c82d382a2020e598a58135841305da9395e7001e (patch) | |
tree | c6c052c5d88fe254dd30c729d924bbbbea9057fa /lib/private/Files/Cache | |
parent | 86f5fb0c9b9f0d4fd9721d05f04d6dedb5315c29 (diff) | |
download | nextcloud-server-c82d382a2020e598a58135841305da9395e7001e.tar.gz nextcloud-server-c82d382a2020e598a58135841305da9395e7001e.zip |
feat: add base class for extending the query builder
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Files/Cache')
-rw-r--r-- | lib/private/Files/Cache/Cache.php | 4 | ||||
-rw-r--r-- | lib/private/Files/Cache/CacheQueryBuilder.php | 13 | ||||
-rw-r--r-- | lib/private/Files/Cache/FileAccess.php | 4 | ||||
-rw-r--r-- | lib/private/Files/Cache/QuerySearchHelper.php | 4 |
4 files changed, 7 insertions, 18 deletions
diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index 3c871fdf4dc..c132ac1f034 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -87,9 +87,7 @@ class Cache implements ICache { protected function getQueryBuilder() { return new CacheQueryBuilder( - $this->connection, - $this->systemConfig, - $this->logger, + $this->connection->getQueryBuilder(), $this->metadataManager, ); } diff --git a/lib/private/Files/Cache/CacheQueryBuilder.php b/lib/private/Files/Cache/CacheQueryBuilder.php index 9bf5f970458..76eb2bfa5ca 100644 --- a/lib/private/Files/Cache/CacheQueryBuilder.php +++ b/lib/private/Files/Cache/CacheQueryBuilder.php @@ -8,27 +8,22 @@ declare(strict_types=1); */ namespace OC\Files\Cache; -use OC\DB\QueryBuilder\QueryBuilder; -use OC\SystemConfig; +use OC\DB\QueryBuilder\ExtendedQueryBuilder; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\FilesMetadata\IFilesMetadataManager; use OCP\FilesMetadata\IMetadataQuery; -use OCP\IDBConnection; -use Psr\Log\LoggerInterface; /** * Query builder with commonly used helpers for filecache queries */ -class CacheQueryBuilder extends QueryBuilder { +class CacheQueryBuilder extends ExtendedQueryBuilder { private ?string $alias = null; public function __construct( - IDBConnection $connection, - SystemConfig $systemConfig, - LoggerInterface $logger, + IQueryBuilder $queryBuilder, private IFilesMetadataManager $filesMetadataManager, ) { - parent::__construct($connection, $systemConfig, $logger); + parent::__construct($queryBuilder); } public function selectTagUsage(): self { diff --git a/lib/private/Files/Cache/FileAccess.php b/lib/private/Files/Cache/FileAccess.php index 5818017bd66..11a95b5d897 100644 --- a/lib/private/Files/Cache/FileAccess.php +++ b/lib/private/Files/Cache/FileAccess.php @@ -31,9 +31,7 @@ class FileAccess implements IFileAccess { private function getQuery(): CacheQueryBuilder { return new CacheQueryBuilder( - $this->connection, - $this->systemConfig, - $this->logger, + $this->connection->getQueryBuilder(), $this->metadataManager, ); } diff --git a/lib/private/Files/Cache/QuerySearchHelper.php b/lib/private/Files/Cache/QuerySearchHelper.php index c31d62e1a86..5af43455ea3 100644 --- a/lib/private/Files/Cache/QuerySearchHelper.php +++ b/lib/private/Files/Cache/QuerySearchHelper.php @@ -39,9 +39,7 @@ class QuerySearchHelper { protected function getQueryBuilder() { return new CacheQueryBuilder( - $this->connection, - $this->systemConfig, - $this->logger, + $this->connection->getQueryBuilder(), $this->filesMetadataManager, ); } |