title: I can't create multiple object of an entity at once
body: <p>I'm learning Symfony and I have a situation where I need, after a form, to create multiple object of an entity A.</p>
  
  <p>All these objects are quite identical but just the value of one field change which is a relation OneToMany to an entity B. In the form this relation is selected with checkbox (that are EntityType related to B), and so I want to create one object A for each checked boxes.
  My issue is that the First's form allows me to create only one object of First type at a time.
  It is a project given by my teachers, and I mustn't create a ManyToMany relation.</p>
  
  <p>Can somebody help me?</p>
  
  <p>Here is the code in the Controller:</p>
  
  <pre><code>$A = new A();
  
  $form = $this-&gt;createForm(AType::class, $A);
  $form-&gt;handleRequest($request);
  
  if ($form-&gt;isSubmitted() &amp;&amp; $form-&gt;isValid()) {
          $entityManager = $this-&gt;getDoctrine()-&gt;getManager();
          $entityManager-&gt;persist($A);
          $entityManager-&gt;flush();
  }
  </code></pre>
  
  <p>And here is the code in the FormType:</p>
  
  <pre><code>$builder
          -&gt;add('anotherField')
          -&gt;add('idB', EntityType::class, [
                  'label' =&gt; 'B',
                  'class' =&gt; B::class,
                  'expanded' =&gt; true,
                  'multiple' =&gt; true
          ])
  ;
  </code></pre>