Limit amount of records retrieved when using Doctrine DQL in Symfony2

后端 未结 1 1033
既然无缘
既然无缘 2021-01-01 09:23

I have the following query:

   $latestcontent = $em->createQuery(\'
            SELECT c.title, c.content, c.lastedit, a.firstname, a.surname
                     


        
相关标签:
1条回答
  • 2021-01-01 10:15

    There is no statement like LIMIT for DQL currently, as far as I know.

    You have to use Query::setMaxResults().

    0 讨论(0)
提交回复
热议问题