Implement tag filtering
This commit is contained in:
@ -79,6 +79,13 @@ class SnipRepository extends ServiceEntityRepository
|
||||
throw new \InvalidArgumentException('Invalid sort option: ', $request->sort);
|
||||
}
|
||||
|
||||
if ($request->tag) {
|
||||
$qb->innerJoin('s.tags', 't')
|
||||
->andWhere('t.name = :tag')
|
||||
->setParameter('tag', $request->tag)
|
||||
;
|
||||
}
|
||||
|
||||
return $qb->getQuery()->getResult();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user