title: Entity field type custom query parameter
body: <p>I want to build a <code>Entity</code> field type in Symfony 2 and pass a parameter to query builder for filter list of related objects:</p>
  
  <pre><code>$formMapper
              -&gt;add('article_subcategories', 'entity',
                      array(
                           'label' =&gt; 'Podkategorie',
                           'multiple' =&gt; true,
                           'expanded' =&gt; true,
                           'read_only' =&gt; true,
                           'class' =&gt; 'FachowoArticleBundle:ArticleSubcategory',
                           'query_builder' =&gt; function (EntityRepository $er)
                           {
                               return $er
                                       -&gt;createQueryBuilder('sc')
                                        -&gt;where('sc.article_category = :id')
                                        -&gt;orderBy('sc.name', 'ASC')
                                        -&gt;setParameter('id', $id);
                           }
                      ));
  </code></pre>
  
  <p>How can i pass $id to this function inside formMapper ? </p>