title: Symfony2 entity field in a form
body: <p>I'm trying to create a simple form to add companies and i've a trouble using an entity.</p>
  
  <p>I added a select field using a company type entity :</p>
  
  <pre><code>-&gt;add('idtypesociete', 'entity', array('class' =&gt; 'PromocastUtilisateurBundle:PcastTypesociete', 'property' =&gt; 'nomtypesociete'))
  </code></pre>
  
  <p>But when i submit the form my idtypesociete field contain an 'PcastTypesociete' object and not just the value of the option selected. So the submission fail.</p>
  
  <p>I made a Many-To-One relation between my company entity and my typeCompany entity like this:</p>
  
  <pre><code>/**
   * @var integer $idtypesociete
   *
   * @ORM\Column(name="IDTYPESOCIETE", type="integer", nullable=false)
   * @ORM\ManyToOne(targetEntity="Promocast\UtilisateurBundle\Entity\PcastTypesociete")
   * @ORM\JoinColumns({
   *  @ORM\JoinColumn(name="PcastTypesociete_idtypesociete", referencedColumnName="idtypesociete")
   * })
   */
  private $idtypesociete;
  </code></pre>
  
  <p>Do you have a solution to get only the id of the company type selected? (if possible without made a simple sql request to list my companies types)</p>
  
  <p>Thanks a lot !</p>