From 11c6c9a2b89773360d94cd957872e07b3828b66e Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 23 Jan 2022 17:45:13 +0100 Subject: [PATCH] Removed unneeded lines --- composer.json | 2 +- module/Core/src/Repository/TagRepository.php | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 1e54bf3a..ba5f968b 100644 --- a/composer.json +++ b/composer.json @@ -64,8 +64,8 @@ "cebe/php-openapi": "^1.5", "devster/ubench": "^2.1", "dms/phpunit-arraysubset-asserts": "^0.3.0", - "eaglewu/swoole-ide-helper": "dev-master", "infection/infection": "^0.26", + "openswoole/ide-helper": "~4.9.1", "phpspec/prophecy-phpunit": "^2.0", "phpstan/phpstan": "^1.2", "phpstan/phpstan-doctrine": "^1.0", diff --git a/module/Core/src/Repository/TagRepository.php b/module/Core/src/Repository/TagRepository.php index 1ee5404b..aa24e0a1 100644 --- a/module/Core/src/Repository/TagRepository.php +++ b/module/Core/src/Repository/TagRepository.php @@ -63,9 +63,6 @@ class TagRepository extends EntitySpecificationRepository implements TagReposito $apiKey = $filtering?->apiKey(); $this->applySpecification($subQb, new WithInlinedApiKeySpecsEnsuringJoin($apiKey), 't'); - $subQuery = $subQb->getQuery(); - $subQuerySql = $subQuery->getSQL(); - // A native query builder needs to be used here, because DQL and ORM query builders do not support // sub-queries at "from" and "join" level. // If no sub-query is used, the whole list is loaded even with pagination, making it very inefficient. @@ -77,7 +74,7 @@ class TagRepository extends EntitySpecificationRepository implements TagReposito 'COUNT(DISTINCT s.id) AS short_urls_count', 'COUNT(DISTINCT v.id) AS visits_count', ) - ->from('(' . $subQuerySql . ')', 't') + ->from('(' . $subQb->getQuery()->getSQL() . ')', 't') ->leftJoin('t', 'short_urls_in_tags', 'st', $nativeQb->expr()->eq('t.id_0', 'st.tag_id')) ->leftJoin('st', 'short_urls', 's', $nativeQb->expr()->eq('s.id', 'st.short_url_id')) ->leftJoin('st', 'visits', 'v', $nativeQb->expr()->eq('s.id', 'v.short_url_id'))