PostRepository#getPostWithComments() fixed.

This commit is contained in:
Alexey Skobkin 2016-03-29 09:52:21 +03:00
parent 6d10b6dac1
commit f4f33a8947

View file

@ -16,6 +16,7 @@ class PostRepository extends EntityRepository
->leftJoin('p.comments', 'c') ->leftJoin('p.comments', 'c')
->leftJoin('c.author', 'a') ->leftJoin('c.author', 'a')
->where($qb->expr()->eq('p.id', ':post_id')) ->where($qb->expr()->eq('p.id', ':post_id'))
->orderBy('c.number', 'asc')
->setParameter('post_id', $postId) ->setParameter('post_id', $postId)
->getQuery()->getOneOrNullResult() ->getQuery()->getOneOrNullResult()
; ;