aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Repository/EntryRepository.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2020-04-20 19:00:58 +0200
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2020-04-20 19:00:58 +0200
commit4b997bc8b27fc25efd1f7a0797b78ee666ef9688 (patch)
treec75d7900ee1c30a7ee323efbf760d6389916b1b9 /src/Wallabag/CoreBundle/Repository/EntryRepository.php
parent7443da479f5289c2ceebb96c0cd4273f6445ca37 (diff)
downloadwallabag-4b997bc8b27fc25efd1f7a0797b78ee666ef9688.tar.gz
wallabag-4b997bc8b27fc25efd1f7a0797b78ee666ef9688.tar.zst
wallabag-4b997bc8b27fc25efd1f7a0797b78ee666ef9688.zip
Added route to list entries with annotations
Diffstat (limited to 'src/Wallabag/CoreBundle/Repository/EntryRepository.php')
-rw-r--r--src/Wallabag/CoreBundle/Repository/EntryRepository.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
index bfd07937..9f25ad4c 100644
--- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
@@ -116,6 +116,21 @@ class EntryRepository extends EntityRepository
116 } 116 }
117 117
118 /** 118 /**
119 * Retrieve entries with annotations for a user.
120 *
121 * @param int $userId
122 *
123 * @return QueryBuilder
124 */
125 public function getBuilderForAnnotationsByUser($userId)
126 {
127 return $this
128 ->getSortedQueryBuilderByUser($userId)
129 ->innerJoin('e.annotations', 'a')
130 ;
131 }
132
133 /**
119 * Retrieve untagged entries for a user. 134 * Retrieve untagged entries for a user.
120 * 135 *
121 * @param int $userId 136 * @param int $userId
@@ -520,6 +535,10 @@ class EntryRepository extends EntityRepository
520 $qb->leftJoin('e.tags', 't'); 535 $qb->leftJoin('e.tags', 't');
521 $qb->andWhere('t.id is null'); 536 $qb->andWhere('t.id is null');
522 break; 537 break;
538 case 'with_annotations':
539 $qb->leftJoin('e.annotations', 'a');
540 $qb->andWhere('a.id is not null');
541 break;
523 } 542 }
524 543
525 $ids = $qb->getQuery()->getArrayResult(); 544 $ids = $qb->getQuery()->getArrayResult();