I have the following query:
$query = $em->createQueryBuilder()->select('p')
->from("ShopMainBundle:ShopPicture", 'p')
->innerJoin('p.shop', 'shop')
;
I wanted to get the pictures from each unique shop. How do I do this? In other words I want to specify that each p should belong to X.