title: Where and how to set an SQL request for a form element?
body: <p>I read a lot of things of things in the cookbook or on stackoverflow but I can't find something adapted and clearly explained about how to solve my problem.</p>
  
  <p>I have an SQL request that allows me to find schools that teaches a specific subject. I need to set this SQL request so that when I load the page containing my form, the request is done and I see the result (a list of school) in a multi select form. My best guess is that I need to set it inside my controller, but then again, I'm not even sure of that since it's the first time that I need to do that</p>
  
  <p>I don't know if I should show you any code, so ask if you need to see something!</p>
  
  <p>Thank you in advance</p>
  
  <p><strong>edit</strong> Here is my formType</p>
  
  <pre><code>&lt;?php
  
  namespace MissionBundle\Form;
  
  use Symfony\Component\Form\AbstractType;
  use Symfony\Component\Form\FormBuilderInterface;
  use Symfony\Component\OptionsResolver\OptionsResolver;
  use Symfony\Bridge\Doctrine\Form\Type\EntityType;
  use SocieteBundle\Entity\Societe;
  
  class PublicType extends AbstractType{
      /**
       * @param FormBuilderInterface $builder
       * @param array $options
       */
      public function buildForm(FormBuilderInterface $builder, array $options)
      {
  
          $builder
              -&gt;add('public')
              -&gt;add('ecolesDispo')
              // My goal is to replace 'ecolesDispo' (that is currently a one-to-many) 
              // by my SQL request. 
        ;
  
      }
  
      /**
       * @param OptionsResolver $resolver
       */
      public function configureOptions(OptionsResolver $resolver)
      {
          $resolver-&gt;setDefaults(array(
              'data_class' =&gt; 'MissionBundle\Entity\Mission'
          ));
      }
  }
  </code></pre>