title: Symfony form to create a collection of entities sharing inputs
body: <p>I need to make a form to create a collection of the same entity, but I do not want to repeat all fields for each entry of the collection (only fields which will have different values).</p>
  
  <p>Imagine a <code>Product</code> entity:</p>
  
  <pre class="lang-php prettyprint-override"><code>class Product
  {
      private $category;
      private $name;
      private $price;
  }
  </code></pre>
  
  <p>I would like a form to create multiple <code>Product</code> entities of the same <code>category</code> at the same time.
  So the form should have one <code>category</code> field, and a collection of <code>name</code> and <code>price</code>.</p>
  
  <p>My form will look something like:</p>
  
  <pre class="lang-php prettyprint-override"><code>class ProductCollectionType extends AbstractType
  {
      public function buildForm(FormBuilderInterface $builder, array $options)
      {
          $builder
              -&gt;add('category')
              -&gt;add('products', CollectionType::class, array(
                  'entry_type' =&gt; ProductType::class,
                  'allow_add'  =&gt; true,
                  'mapped'     =&gt; false,
              ))
          ;
      }
  
      public function configureOptions(OptionsResolver $resolver)
      {
          $resolver-&gt;setDefaults(array(
              'data_class' =&gt; Product::class,
          ));
      }
  }
  
  class ProductType extends AbstractType
  {
      public function buildForm(FormBuilderInterface $builder, array $options)
      {
          $builder
              -&gt;add('name')
              -&gt;add('price')
          ;
      }
  
      public function configureOptions(OptionsResolver $resolver)
      {
          $resolver-&gt;setDefaults(array(
              'data_class' =&gt; Product::class,
          ));
      }
  }
  </code></pre>
  
  <p>Anyone know if there is a way to automatically fill all entities in the collection type with the parent fields? (only <code>category</code> in this example)</p>
  
  <p>Thanks!</p>