title: Adding custom function to doctrine query builder group by clause
body: <p>I want to group data by year and month of a date column using doctrine.
  It currently uses the query builder to produce the statement which is working fine apart from the grouping.
  I have installed the Month and Year custom functions from the Doctrine Extensions pack, however, I cannot do the following:</p>
  
  <pre><code>$qb-&gt;add('groupBy', 'MONTH(i.instdate)');
  </code></pre>
  
  <p>I get an Error: Cannot group by undefined identification variable message.</p>
  
  <p>Is this possible with the query builder?
  If not can I add DQL to a query builder result? What is the best way to do this?
  I don't want to change the whole system to DQL as it is a query built from form options on the fly, so that would be a major change.</p>