diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Repository/EntryRepository.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Repository/EntryRepository.php | 19 |
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(); |