I have a basic table article
linked to a table category
by id
(classic), I would like to make a doctrine request to retrieve only 5 articles by category (for all categories)
This request return me all articles of categories, I just want 5 for each
public function getArticlesAndCategs(){
$qb = $this->createQueryBuilder('c')
->orderBy('c.id','DESC')
->leftJoin('c.articles', 'a')
->addSelect('a')
->addOrderBy('a.id','DESC')
->getQuery();
return $qb->execute();
}
Can you help me for that? thank you