From 567421af5019bf5937aa2b4214b405d87a1f1f86 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 10 Feb 2016 17:41:28 +0100 Subject: remove tag from entry #1377 --- src/Wallabag/CoreBundle/Repository/TagRepository.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/Wallabag/CoreBundle/Repository/TagRepository.php') diff --git a/src/Wallabag/CoreBundle/Repository/TagRepository.php b/src/Wallabag/CoreBundle/Repository/TagRepository.php index c4aeb594..8d9cf85c 100644 --- a/src/Wallabag/CoreBundle/Repository/TagRepository.php +++ b/src/Wallabag/CoreBundle/Repository/TagRepository.php @@ -51,4 +51,20 @@ class TagRepository extends EntityRepository ->getQuery() ->getResult(); } + + /** + * Used only in test case to get a tag for our entry. + * + * @return Tag + */ + public function findOnebyEntryAndLabel($entry, $label) + { + return $this->createQueryBuilder('t') + ->leftJoin('t.entries', 'e') + ->where('e.id = :entryId')->setParameter('entryId', $entry->getId()) + ->andWhere('t.label = :label')->setParameter('label', $label) + ->setMaxResults(1) + ->getQuery() + ->getSingleResult(); + } } -- cgit v1.2.3