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:
commit
ec00964de2
9 changed files with 186 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue