title: Symfony2: form entity group_by ManyToMany
body: <p>I have a formtype with this entry:</p>
  
  <pre><code>-&gt;add('work', 'entity', array(
      'class' =&gt; 'AcmeAdminBundle:Work',
      'property' =&gt; 'name',
      'query_builder' =&gt; function (EntityRepository $repository) {
          return $repository-&gt;createQueryBuilder('work')
              -&gt;orderBy('work.name', 'ASC');
      },
      'multiple' =&gt; true,
      'required' =&gt; false,
      'group_by' =&gt; 'artists'
  ))
  </code></pre>
  
  <p>I'm trying to group the works by their artists name. The problem is that the artists are a ManyToMany like this:</p>
  
  <pre><code>class Work
  {
      /**
       * @ORM\ManyToMany(targetEntity="Artist", inversedBy="works")
       * @ORM\JoinTable(name="works_artists")
       */
      protected $artists;
  </code></pre>
  
  <p>I tried setting the group_by to "artists" and "artists.name" but neither work. I only get a PHP error.</p>
  
  <p>Does anyone know how to do it or if it is possible?</p>