Join subquery with doctrine 2 DBAL
I’ve found a solution by adapting this DQL example to DBAL. The trick is to get the raw SQL of the subquery, wrap it in brackets, and join it. Parameters used in the subquery must be set in the main query: Important it’s the createQueryBuilder of connection not the one of the entity manager. $subSelect … Read more