title: Symfony2 - data from a form collection element ends up as arrays instead of Entities
body: <p>I have two Doctrine entities that have a one-to-many relationship, like this:</p>
  
  <p>License</p>
  
  <pre><code>class License {    
      /**
       * Products this license contains
       * 
       * @var \Doctrine\Common\Collections\ArrayCollection
       * @ORM\OneToMany(targetEntity="LicenseProductRelation", mappedBy="license")
       */
      private $productRelations;
  }
  </code></pre>
  
  <p>LicenseProductRelation:</p>
  
  <pre><code>class LicenseProductRelation {
      /**
       * The License referenced by this relation
       * 
       * @var \ISE\LicenseManagerBundle\Entity\License
       * @ORM\Id
       * @ORM\ManyToOne(targetEntity="License", inversedBy="productRelations")
       * @ORM\JoinColumn(name="license_id", referencedColumnName="id", nullable=false)
       */
      private $license;
  }
  </code></pre>
  
  <p>And I have this form for the License entity:</p>
  
  <pre><code>class LicenseType extends AbstractType {
  
      public function buildForm(FormBuilder $builder, array $options)
      {
          parent::buildForm($builder, $options);
          $builder-&gt;add('productRelations', 'collection',
              array('type' =&gt; new LicenseProductRelationType(),
                    'allow_add' =&gt; true,
                    'allow_delete' =&gt; true,
                    'prototype' =&gt; true,
                    'label' =&gt; 'Produkte'));
      }
  }
  </code></pre>
  
  <p>And this form for the LicenseProductRelation entity:</p>
  
  <pre><code>class LicenseProductRelationType extends AbstractType {
      public function buildForm(FormBuilder $builder, array $options) {
          parent::buildForm($builder, $options);
          $builder-&gt;add('license', 'hidden');
      }
  }
  </code></pre>
  
  <p>The forms and entities do of course contain other fields, not copied here to keep the post relatively short.</p>
  
  <p>Now when I submit the form and bind the request to the form in my controller, I expect the call <code>$license-&gt;getProductRelations()</code> to return an array of LicenseProductRelation objects (<code>$license</code> is the entity passed in to the form, thus the object the request values are written to when I call <code>$form-&gt;bindRequest()</code>). Instead, it returns an array of arrays, the inner arrays containing the form field names and values.</p>
  
  <p>Is this normal behaviour or did I make an error that somehow prevents the form component from understanding that <code>License#productRelations</code> shound be an array of LicenseProductRelation objects?</p>