From 4c8dfe335a27c222fd37e4c2fb3c94d0b0bf8a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 30 Apr 2020 17:15:08 +0200 Subject: Fixed repository to retrieve articles --- src/Wallabag/CoreBundle/Repository/EntryRepository.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/Wallabag/CoreBundle/Repository/EntryRepository.php') diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index f2c73bbf..23d1e37e 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -52,14 +52,21 @@ class EntryRepository extends EntityRepository */ public function getBuilderForSameDomainByUser($userId, $entryId) { - dump($entryId);die; - - $ + $queryBuilder = $this->createQueryBuilder('e'); return $this ->getSortedQueryBuilderByUser($userId) - ->andWhere('e.isArchived = false') - ; + ->andWhere('e.id <> :entryId')->setParameter('entryId', $entryId) + ->andWhere( + $queryBuilder->expr()->in( + 'e.domainName', + $this + ->createQueryBuilder('e2') + ->select('e2.domainName') + ->where('e2.id = :entryId')->setParameter('entryId', $entryId) + ->getDQL() + ) + ); } /** -- cgit v1.2.3