1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-10-20 19:52:09 +00:00

Merge pull request #1372 from wallabag/v2-assign-tags

assign tags to an entry
This commit is contained in:
Jeremy Benoist 2015-08-22 12:56:42 +02:00
commit ec00964de2
9 changed files with 186 additions and 2 deletions

View file

@ -24,4 +24,21 @@ class TagRepository extends EntityRepository
return new Pagerfanta($pagerAdapter);
}
/**
* Find a tag by its label and its owner.
*
* @param string $label
* @param int $userId
*
* @return Tag|null
*/
public function findOneByLabelAndUserId($label, $userId)
{
return $this->createQueryBuilder('t')
->where('t.label = :label')->setParameter('label', $label)
->andWhere('t.user = :user_id')->setParameter('user_id', $userId)
->getQuery()
->getOneOrNullResult();
}
}