title: Save symfony2 entity form with entity field
body: <p>I have a City Add form:</p>
  
  <pre><code>public function buildForm(FormBuilderInterface $builder, array $options)
      {
          $builder-&gt;add('name', null, array(
              'label' =&gt; 'City',
          ));
          $builder-&gt;add('country', 'genemu_jqueryautocompleter_entity', array(
              'class' =&gt; 'X\tBundle\Entity\Country',
              'property' =&gt; 'name',
              'route_name' =&gt; 'ajax_country',
              'required' =&gt; true,
              'label' =&gt; 'Country',
          ));
      }
  </code></pre>
  
  <p>Country is an Entity. When I submit this form - S2 returns an error: <code>cannot save because cannot convert Object to String</code></p>
  
  <p>For this I'm using magic method <code>__toString()</code> and it returns <code>(string)$this-&gt;getId()</code>;</p>
  
  <p>But I'm not sure - is this right?</p>
  
  <p><strong>Desicion:</strong> <a href="https://stackoverflow.com/questions/11512262/symfony-doctrine-catchable-fatal-error-object-of-class-type-could-not-be-co">Symfony/Doctrine: &quot;Catchable Fatal Error: Object of class &lt;type&gt; could not be converted to string&quot; when persisting</a></p>