Doctrine class map inheritance and join

Viewed 457

I have 2 entities (ProductX and ProductY), herited from Product (inheritance type: JOINED, with Discriminator). I need to add a condition on ProductX or productY field. But the query builder doesn't show this entities.

I try :$queryBuilder->leftJoin('App\Entity\ProductX', 'productX', 'WITH', 'o.id = productX.id');

But in this case, the generated DQL is :

LEFT JOIN ( product_x p8_ INNER JOIN product p9_ ON p8_.id = p9_.id ) ON (p0_.id = p9_.id)

instead of :

LEFT JOIN product_x p8_ ON p0_.id = p8_.id

Any idea to do that ?

1 Answers
Related