Doctrine2: Arbitrary join and single table inheritance

后端 未结 3 1373
旧巷少年郎
旧巷少年郎 2021-02-20 17:28

Note: This is an ORM limitation reported on the project\'s issue tracker

I\'m facing an issue building a DQL query using the arbitrary join syntax introduced in

3条回答
  •  野性不改
    2021-02-20 17:56

    Have you tried an inner join instead a left join? The query that you need probably could

    SELECT a.id, 
           b.id 
    FROM   a 
           INNER JOIN b 
                   ON ( a.something = b.something ) 
    WHERE  b.type IN ( '1', '2', '3' ) 
    

    You can get that changing the function leftJoin by join, or creating the query with the createQuery method for customs queries.

提交回复
热议问题