I want to make a fetchAll() with limit ? Do you know if it's possible with the entity manager of symfony2 ?
My current code (Fetch all, without limit):
$repository = $this->getDoctrine()->getRepository('MyBundle:Download');
$product = $repository->findAll();
Thanks you all. Best regards,
EDIT:
$em = $this->getDoctrine()->getRepository('MyBundle:Download');
$ouput = $em->findBy(array(), array('id' => 'DESC'),5);
Return the 5 last rows.
Thanks all.
It's often instructive to check the source code.