diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Repository/TagRepository.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Repository/TagRepository.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Repository/TagRepository.php b/src/Wallabag/CoreBundle/Repository/TagRepository.php index c4aeb594..afeb985b 100644 --- a/src/Wallabag/CoreBundle/Repository/TagRepository.php +++ b/src/Wallabag/CoreBundle/Repository/TagRepository.php | |||
@@ -51,4 +51,20 @@ class TagRepository extends EntityRepository | |||
51 | ->getQuery() | 51 | ->getQuery() |
52 | ->getResult(); | 52 | ->getResult(); |
53 | } | 53 | } |
54 | |||
55 | /** | ||
56 | * Used only in test case to get a tag for our entry. | ||
57 | * | ||
58 | * @return Tag | ||
59 | */ | ||
60 | public function findOneByEntryAndTagLabel($entry, $label) | ||
61 | { | ||
62 | return $this->createQueryBuilder('t') | ||
63 | ->leftJoin('t.entries', 'e') | ||
64 | ->where('e.id = :entryId')->setParameter('entryId', $entry->getId()) | ||
65 | ->andWhere('t.label = :label')->setParameter('label', $label) | ||
66 | ->setMaxResults(1) | ||
67 | ->getQuery() | ||
68 | ->getSingleResult(); | ||
69 | } | ||
54 | } | 70 | } |