title: Symfony 3 - Forms - Persist Entity - Choices are NULL
body: <p>I'm new to Symfony and cannot easily find Symfony 3 answers to my question.</p>
  
  <p>Problem : 
  I have a basic form setup which populates select boxes with basic id+name Entity values (Country, Company, Partner, etc.)</p>
  
  <p>All the select boxes are correctly populated from the DB.
  However when I try saving the populated form, all the "choices" are returned as null.</p>
  
  <p>Question : 
  What am i missing to make sure the selected values in the selectboxes are sent through to the INSERT statement ?</p>
  
  <p>Note : I have looked at the <a href="http://symfony.com/doc/current/forms.html" rel="nofollow noreferrer">Form documentation</a> but that didn't seem to cover this scenario.</p>
  
  <p>Form : 
  <a href="https://i.stack.imgur.com/6pLVg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6pLVg.png" alt="Populated form"></a></p>
  
  <p>Result on Submit : 
  <a href="https://i.stack.imgur.com/8x3bJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8x3bJ.png" alt="Submit result"></a></p>
  
  <p><strong>Controller excerpt :</strong> </p>
  
  <pre><code>/**
   * @Route("/opportunity/add", name="add_opportunity")
   */
  public function addAction(Request $request)
  {
      $em = $this-&gt;getDoctrine()-&gt;getManager();
  
      $opportunity = new Opportunity();
      $form = $this-&gt;createForm(OpportunityType::class, $opportunity);
  
      $form-&gt;handleRequest($request);
      if ($form-&gt;isSubmitted() &amp;&amp; $form-&gt;isValid()) {
  
          $em-&gt;persist($opportunity);
          $em-&gt;flush();
  
          return $this-&gt;redirectToRoute('/opportunity/add');
      }
  
      return $this-&gt;render(
          'opportunity/add-opportunity.html.twig',
          array('form' =&gt; $form-&gt;createView())
      );
  }
  </code></pre>
  
  <p><strong>Build Form from OpportunityType :</strong> </p>
  
  <pre><code>public function buildForm(FormBuilderInterface $builder, array $options)
  {
      $builder
          -&gt;add('name', TextType::class)
  
          -&gt;add('countries', EntityType::class, array(
              'class' =&gt; 'AppBundle:Country',
              'choice_label' =&gt; 'name'
          ))
  
          -&gt;add('partners', EntityType::class, array(
              'class' =&gt; 'AppBundle:Partner',
              'choice_label' =&gt; 'name'
          ))
  
          -&gt;add('companies', EntityType::class, array(
              'class' =&gt; 'AppBundle:Company',
              'choice_label' =&gt; 'name'
          ))
  
          -&gt;add('users', EntityType::class, array(
              'class' =&gt; 'AppBundle:User',
              'choice_label' =&gt; 'name'
          ))
  
          -&gt;add('stages', EntityType::class, array(
              'class' =&gt; 'AppBundle:Stage',
              'choice_label' =&gt; 'name'
          ))
  
          -&gt;add('stage_changed_date', DateType::class)
          -&gt;add('target_close_date', DateType::class)
          -&gt;add('contract_value', TextType::class)
  
      ;
  }
  </code></pre>
  
  <p><strong>Form twig :</strong></p>
  
  <pre><code>{% block body %}
  &lt;div style="max-width: 600px; margin-top:100px; padding:15px; margin-left:auto; margin-right:auto;" class="card"&gt;
  {{ form_start(form) }}
      &lt;div class="form-header purple darken-4"&gt;
          &lt;h3&gt;&lt;i class="fa"&gt;&lt;/i&gt;Add Opportunity&lt;/h3&gt;
      &lt;/div&gt;
      {{ form_row(form.name) }}
      {{ form_row(form.countries) }}
      {{ form_row(form.partners) }}
      {{ form_row(form.companies) }}
      {{ form_row(form.users) }}
      {{ form_row(form.stages) }}
      {{ form_row(form.stage_changed_date) }}
      {{ form_row(form.target_close_date) }}
      {{ form_row(form.contract_value) }}
  
      &lt;button class="btn btn-raised btn-primary" type="submit"&gt;ADD&lt;/button&gt;
  {{ form_end(form) }}
  &lt;/div&gt;
  </code></pre>
  
  <p>{% endblock %}</p>