title: Symfony4/Doctrine - mapping '_id' form data attribute directly to entity
body: <p>I am trying to submit a POST request containing, amongst other things, 'company_id'.</p>
  
  <p>I want to map this to the property 'Company' of a Doctrine/Symfony4 entity. This field is stored in the 'company_id' column.</p>
  
  <p>My form is pretty vanilla and uses the following to map the incoming request:</p>
  
  <pre><code>        -&gt;add('company_id', EntityType::class, [
              'class' =&gt; Company::class,
          ])
  </code></pre>
  
  <p>The problem is, my model class only has the methods 'getCompany' and 'setCompany' which leads to the following error:</p>
  
  <pre><code>{
      "code": 500,
      "message": "Neither the property \"company_id\" nor one of the methods \"getCompanyId()\", \"companyId()\", \"isCompanyId()\", \"hasCompanyId()\", \"__get()\" exist and have public access in class \"App\\ServiceProviderBundle\\Entity\\Offer\"."
  }
  </code></pre>
  
  <p>I've made a workaround by creating some proxy methods (e.g. 'getCompanyId' which proxies directly to 'getCompany'), but this feels hacky and incorrect and there must be a way to make this mapping directly.</p>