diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2020-04-30 17:15:08 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2020-04-30 17:15:08 +0200 |
commit | 4c8dfe335a27c222fd37e4c2fb3c94d0b0bf8a61 (patch) | |
tree | e7b133496445791a66b59284b258699f09a5b946 | |
parent | 38f7c4590362e4657402eb1b58ad29b44ec763a6 (diff) | |
download | wallabag-4c8dfe335a27c222fd37e4c2fb3c94d0b0bf8a61.tar.gz wallabag-4c8dfe335a27c222fd37e4c2fb3c94d0b0bf8a61.tar.zst wallabag-4c8dfe335a27c222fd37e4c2fb3c94d0b0bf8a61.zip |
Fixed repository to retrieve articlessame-domain
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/ExportController.php | 2 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Repository/EntryRepository.php | 17 |
2 files changed, 13 insertions, 6 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/ExportController.php b/src/Wallabag/CoreBundle/Controller/ExportController.php index cec8d499..824d21bb 100644 --- a/src/Wallabag/CoreBundle/Controller/ExportController.php +++ b/src/Wallabag/CoreBundle/Controller/ExportController.php | |||
@@ -47,7 +47,7 @@ class ExportController extends Controller | |||
47 | * | 47 | * |
48 | * @Route("/export/{category}.{format}", name="export_entries", requirements={ | 48 | * @Route("/export/{category}.{format}", name="export_entries", requirements={ |
49 | * "format": "epub|mobi|pdf|json|xml|txt|csv", | 49 | * "format": "epub|mobi|pdf|json|xml|txt|csv", |
50 | * "category": "all|unread|starred|archive|tag_entries|untagged|search" | 50 | * "category": "all|unread|starred|archive|tag_entries|untagged|search|same_domain" |
51 | * }) | 51 | * }) |
52 | * | 52 | * |
53 | * @return \Symfony\Component\HttpFoundation\Response | 53 | * @return \Symfony\Component\HttpFoundation\Response |
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 | |||
52 | */ | 52 | */ |
53 | public function getBuilderForSameDomainByUser($userId, $entryId) | 53 | public function getBuilderForSameDomainByUser($userId, $entryId) |
54 | { | 54 | { |
55 | dump($entryId);die; | 55 | $queryBuilder = $this->createQueryBuilder('e'); |
56 | |||
57 | $ | ||
58 | 56 | ||
59 | return $this | 57 | return $this |
60 | ->getSortedQueryBuilderByUser($userId) | 58 | ->getSortedQueryBuilderByUser($userId) |
61 | ->andWhere('e.isArchived = false') | 59 | ->andWhere('e.id <> :entryId')->setParameter('entryId', $entryId) |
62 | ; | 60 | ->andWhere( |
61 | $queryBuilder->expr()->in( | ||
62 | 'e.domainName', | ||
63 | $this | ||
64 | ->createQueryBuilder('e2') | ||
65 | ->select('e2.domainName') | ||
66 | ->where('e2.id = :entryId')->setParameter('entryId', $entryId) | ||
67 | ->getDQL() | ||
68 | ) | ||
69 | ); | ||
63 | } | 70 | } |
64 | 71 | ||
65 | /** | 72 | /** |