src/PHPDish/Bundle/PostBundle/Service/PostManager.php
public function findCategoryPosts(CategoryInterface $category, $page = 1, $limit = null)
    {
        $qb = $this->getPostRepository()->createQueryBuilder('p')
            ->join('p.user', 'pu')->addSelect('pu')
            ->where('p.category = :category')->setParameter('category', $category)
            ->andWhere('p.enabled = :enabled')->setParameter('enabled', true)
            ->orderBy('p.createdAt', 'desc');

        return $this->createPaginator($qb->getQuery(), $page, $limit);
    }
public function findCategoryPosts(CategoryInterface $category, $page = 1, $limit = null)
    {
        $qb = $this->getPostRepository()->createQueryBuilder('p')
            ->join('p.user', 'pu')->addSelect('pu')
            ->where('p.category = :category')->setParameter('category', $category)
            ->andWhere('p.enabled = :enabled')->setParameter('enabled', true)
            ->orderBy('p.createdAt', 'desc');

        return $this->createPaginator($qb->getQuery(), $page, $limit);
    }
{@inheritdoc}