title: how to get doctrine repository in form type class in symfony2?
body: <pre><code>$repository = $this-&gt;getDoctrine()-&gt;getRepository('ParabolaEntityBundle:ProjectAllocation');
          $query = $repository-&gt;createQueryBuilder('p')
                  -&gt;where('p.startDate &lt; :sdate and p.employee = :emp and p.endDate &gt; :edate')
                  -&gt;setParameter('sdate', date('Y-m-d', time()))
                  -&gt;setParameter('edate', date('Y-m-d', time()))
                  -&gt;setParameter('emp', $employee-&gt;getId())
                  -&gt;getQuery();
          $projectAllocate = $query-&gt;getResult();
  </code></pre>
  
  <p>how can i use above code in FormType class.I am using this query to generate array for the choice type  in form builder. </p>