title: Specify entity class name in Symfony Doctrine ORM
body: <p>I'm using YAML for configuring the Doctrine ORM mappings in Symfony 4. Is there any way to specify the class name of an entity manually in its config? It seems like the entity's class name is generated based on the name of the yml config file and there is no way to override it.</p>
  
  <p>Say I have a mapping config called <code>Foo.orm.yml</code>. Doctrine is going to think that the actual name of the entity class is <code>Foo</code>. But what if I want the <code>Foo.orm.yml</code> file to map the table onto the class <code>Bar</code>? So I was thinking about something like the <code>class</code> option inside the config, but haven't found anything on the Internet.</p>
  
  <pre><code>#file Foo.orm.yml
  
  Bar:
      class: Bar
      type: entity
      table: bar
      id:
          id:
              type: integer
              generator: { strategy: NONE }
      fields:
          foo:
              type: string
          bar:
              type: boolean
  </code></pre>
  
  <p>XML mappings have the <code>name</code> option though: <a href="http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/xml-mapping.html" rel="nofollow noreferrer">http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/xml-mapping.html</a> which doesn't work in YAML.</p>