title: Symfony - Form with multiple entity objects
body: <p>I'm running Symfony 3.4 LTS and I have an entity <code>Attribute</code>:</p>
  
  <pre><code>&lt;?php
  
  class Attribute
  {
  
      private $id;
      private $code;
      private $value;
      private $active;
  
      // My getters and setters
  </code></pre>
  
  <p>Below the database table:</p>
  
  <p><a href="https://i.stack.imgur.com/tL7SY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tL7SY.png" alt="enter image description here"></a></p>
  
  <p>I would like to get, in a form, all the rows with <code>code == 'productstatus'</code>. I tried:</p>
  
  <pre><code>&lt;?php
  
  $attributes = $this-&gt;getDoctrine()-&gt;getRepository(Attribute::class)-&gt;findBy(['code' =&gt; 'productstatus']);
  // $attributes contains array with 3 objects 'Attribute'
  $form = $this-&gt;createFormBuilder($attributes);
  $form-&gt;add('value', TextType::class);
  $output = $form-&gt;getForm()-&gt;createView();
  </code></pre>
  
  <p>If I dump() the <code>$output</code> var in Twig:</p>
  
  <p><a href="https://i.stack.imgur.com/yHgDs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yHgDs.png" alt="enter image description here"></a></p>
  
  <p>... I'm unable to make a loop to display the 3  fields with values.</p>
  
  <pre><code>{{ form_start(form) }}
  {{ form_widget(form) }}
  {{ form_end(form) }}
  </code></pre>
  
  <p>Result :</p>
  
  <p><a href="https://i.stack.imgur.com/L9IJt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L9IJt.png" alt="enter image description here"></a></p>
  
  <p>My goal is to allow the user to edit all the values of a specific attributes in the same form (or multiple forms, but in the same page). I already tried with CollectionType without success.</p>