title: Object of class Doctrine\ORM\PersistentCollection could not be converted to string
body: <p>I made a web application with Symfony2, in which a User has an array correlation ManytoMany with the entity Mission. The User can upload the entity $product through a form, and one of the data passed by the form is the mission associated to the user. </p>
  
  <p>When I try to upload the data, appears the error:</p>
  
  <pre><code>ContextErrorException: Catchable Fatal Error: Object of class   
  Doctrine\ORM\PersistentCollection could not be converted to string in     
  C:\BitNami\wampstack-5.4.23- 
  0\frameworks\symfony\vendor\doctrine\dbal\lib\Doctrine\DBAL\Statement.php line 103
  </code></pre>
  
  <p>It's clear that Doctrine don't know how to save the value of the mission.</p>
  
  <p>How can I manage it?</p>
  
  <p>I didn't know neither how to declare the mission object in my product entity. Now is simply like this:</p>
  
  <pre><code>/**
   * @var string
   *
   * @ORM\Column(name="mission", type="string", length=255)
   */
  protected $mission;
  </code></pre>
  
  <p>UPDATE ---</p>
  
  <p>My controller now is:</p>
  
  <pre><code>       $form = $this-&gt;createFormBuilder($product)
             -&gt;add('name', 'text')
             -&gt;add('mission', 'entity', array('required' =&gt; true, 'multiple' =&gt; false, 'class' =&gt; 'AcmeManagementBundle:Mission', 'query_builder' =&gt; function($repository) { return $repository-&gt;createQueryBuilder('c')-&gt;orderBy('c.id', 'ASC'); },))              
        //...
             -&gt;add('save', 'submit')
             -&gt;getForm(); 
  </code></pre>
  
  <p>UPDATE ---</p>
  
  <p>Now works, but I have a problem. When appears the form to upload the $product object, appears also the ->add('mission', 'entity'... In this field I can see all the mission stored, and not only the ones associated with the user. How should I change my controller?
  I tried to change my controller like this:</p>
  
  <pre><code>       $product = new Product();
         $product-&gt;setMission($this-&gt;getUser()-&gt;getMission());
  </code></pre>