Doctrine query builder using inner join with conditions
I’m going to answer my own question. innerJoin should use the keyword “WITH” instead of “ON” (Doctrine’s documentation [13.2.6. Helper methods] is inaccurate; [13.2.5. The Expr class] is correct) no need to link foreign keys in join condition as they’re already specified in the entity mapping. Therefore, the following works for me $qb->select(‘c’) ->innerJoin(‘c.phones’, ‘p’, … Read more