title: symfony2 form querybuilder with parameters
body: <p>I want to put my entity in the function of the query builder:</p>
  
  <pre><code>-&gt;add( 'weeks', 'entity', array(
      'class' =&gt; 'MV\CaravanBundle\Entity\CaravanRow',
      'property' =&gt; 'line',
      'query_builder' =&gt; function(EntityRepository $er ) use ( $caravan ) {
          return $er-&gt;createQueryBuilder('w')
                    -&gt;orderBy('w.dateFrom', 'ASC')
                    -&gt;where('w.caravan = ?', $caravan )
                    -&gt;andWhere('w.visible = 1')
                    -&gt;andWhere('w.booked = 0');
  }
  </code></pre>
  
  <p>but get the message: </p>
  
  <blockquote>
    <p>Expression of type 'Entity\Name' not allowed in this context</p>
  </blockquote>
  
  <p>So what is the (best) way to give the querybuilder information.</p>