Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2911

IndexBy doesn' work with arbitrary join

    Details

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

      Description

              $statsQb = $em->createQueryBuilder()
                  ->select('d AS date')
                  ->from('MetalStatisticBundle:Day', 'd', 'd.date')
                  ->leftJoin('MetalStatisticBundle:StatsDaily', 'sd', 'WITH', 'd.date = sd.date', 'sd.date')
                  ->addSelect('sd AS stats')
                  ->andWhere('sd.company = :company_id')
                  ->setParameter('company_id', $company->getId())
                  ->orderBy('sd.date', 'DESC')
                  ->setMaxResults(10)
      

      expected: array like

      2012-10-10 => array(date => object, stats => object)
      2012-10-09 => array(date => object)
      2012-10-08 => array(date => object, stats => object)

      got: exception Expected Literal, got 'BY'

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Konstantin
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: