aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Repository
diff options
context:
space:
mode:
authorJeremy Benoist <j0k3r@users.noreply.github.com>2015-08-22 12:56:42 +0200
committerJeremy Benoist <j0k3r@users.noreply.github.com>2015-08-22 12:56:42 +0200
commitec00964de22a338d8f814c5440f8e09f542fdbbf (patch)
tree4dc70780d5b8278825f423d247b8486a52f7d265 /src/Wallabag/CoreBundle/Repository
parentf9d5155abf1bc63fae91043a5e4c73ac3a4f0ba9 (diff)
parent7244d6cb61912b80341595c56cc22d9bb56e6251 (diff)
downloadwallabag-ec00964de22a338d8f814c5440f8e09f542fdbbf.tar.gz
wallabag-ec00964de22a338d8f814c5440f8e09f542fdbbf.tar.zst
wallabag-ec00964de22a338d8f814c5440f8e09f542fdbbf.zip
Merge pull request #1372 from wallabag/v2-assign-tags
assign tags to an entry
Diffstat (limited to 'src/Wallabag/CoreBundle/Repository')
-rw-r--r--src/Wallabag/CoreBundle/Repository/TagRepository.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Repository/TagRepository.php b/src/Wallabag/CoreBundle/Repository/TagRepository.php
index 9c409607..ac3145a1 100644
--- a/src/Wallabag/CoreBundle/Repository/TagRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/TagRepository.php
@@ -24,4 +24,21 @@ class TagRepository extends EntityRepository
24 24
25 return new Pagerfanta($pagerAdapter); 25 return new Pagerfanta($pagerAdapter);
26 } 26 }
27
28 /**
29 * Find a tag by its label and its owner.
30 *
31 * @param string $label
32 * @param int $userId
33 *
34 * @return Tag|null
35 */
36 public function findOneByLabelAndUserId($label, $userId)
37 {
38 return $this->createQueryBuilder('t')
39 ->where('t.label = :label')->setParameter('label', $label)
40 ->andWhere('t.user = :user_id')->setParameter('user_id', $userId)
41 ->getQuery()
42 ->getOneOrNullResult();
43 }
27} 44}