I want to do a somewhat complex query in doctrine, namely an inner join with a subquery with a group_concat.
See the query in plain SQL:
SELECT *
FROM kinderen k
INNER JOIN
(
SELECT i.kindid, GROUP_CONCAT(DISTINCT a.periode) as periodes
FROM inschrijvingen i
INNER JOIN activiteiten a ON i.activiteitid=a.id
GROUP BY i.kindid
) p
ON k.kindid=p.kindid;
1) How can I do this in doctrine? In other words how can I translate this regular sql into dql?
2) I would like the extra property (periodes) to be accessible in the resulting Kinderen object. I suspect that this is default behavior for doctrine?
I can't find the solution when I read through the docs and google.
Thanx!