add relation between entry and tag

This commit is contained in:
Nicolas Lœuillet
2015-02-20 20:29:33 +01:00
parent 6d37a7e6c1
commit 0a018fe039
6 changed files with 53 additions and 122 deletions

View File

@ -6,5 +6,18 @@ use Doctrine\ORM\EntityRepository;
class TagRepository extends EntityRepository
{
public function findByEntries($entryId)
{
$qb = $this->createQueryBuilder('t')
->select('t')
->leftJoin('t.id', 'u')
->where('e.isStarred = true')
->andWhere('u.id =:userId')->setParameter('userId', $userId)
->orderBy('e.createdAt', 'desc')
->getQuery();
$paginator = new Paginator($qb);
return $paginator;
}
}