Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2891

Impossible to pass a limit to a subquery

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.4.2
    • Fix Version/s: None
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      It seems that passing the limit to a subquery is not working

       
      $subquery = $em->createQueryBuilder()->from('...')->where('...')->setMaxResults(5);
      $query = $em->createQueryBuilder()->from('...')->where(
         $qb->expr()->in('p.id', $subquery->getDQL())
      );
      $query->getQuery()->getResult();
      

      The query works but the is no specified limit in the resulting SQL.
      I am aware that DQL does not support the limits and offsets, so i guess there should be another way to get this working?

        Activity

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            alex
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: