title: Argument 1 passed to?
body: <p>I tries to submit form in symfony2.1 but i got following error, i create form student registration and try to submit it, i reviewed may forums for this but can't got any proper solution.</p>
  
  <pre><code>Error:Catchable Fatal Error: Argument 1 passed to
  Frontend\EntityBundle\Entity\StudentRegistration::setIdCountry()
  must be an instance of Frontend\EntityBundle\Entity\MasterCountry, string given,
  called in C:\wamp\www\careerguide\src\Frontend\HomeBundle\Controller\RegistrationController.php
  on line 41 and defined in C:\wamp\www\careerguide\src\Frontend\EntityBundle\Entity\StudentRegistration.php line 1253 
  </code></pre>
  
  <p>In controller i have:</p>
  
  <pre><code>$student_account = new \Frontend\EntityBundle\Entity\StudentRegistration();
  $params = $request-&gt;get('student_registration');
  $student_account-&gt;setIdCountry($params['idCountry']);
  $em = $this-&gt;getDoctrine()-&gt;getEntityManager();
  $em-&gt;persist($student_account);
  $em-&gt;flush();
  </code></pre>
  
  <p>Entity class:</p>
  
  <pre><code>/**
   * @var MasterCountry
   *
   * @ORM\ManyToOne(targetEntity="MasterCountry")
   * @ORM\JoinColumns({
   *   @ORM\JoinColumn(name="id_country", referencedColumnName="id_country")
   * })
   */
  private $idCountry;
  </code></pre>
  
  <p>Please suggest me what i do to resolved this error?</p>