title: How to do a subquery in doctrine and get the result hydrated to an object?
body: <p>I want to do a somewhat complex query in doctrine, namely an inner join with a subquery with a group_concat.</p>
  
  <p>See the query in plain SQL:</p>
  
  <pre><code>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;
  </code></pre>
  
  <p>1) How can I do this in doctrine? In other words how can I translate this regular sql into dql?</p>
  
  <p>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?</p>
  
  <p>I can't find the solution when I read through the docs and google.</p>
  
  <p>Thanx!</p>