symfony/symfony — Issue #3467: doctrine:mapping:import does not respect metadata class name
Author: coviex
Created: 2012-02-28 11:11:37+00:00
State: open

Hi,
Lets say I have "actors" table in my MySQL database.
I run (step1)

php app/console doctrine:mapping:convert --from-database --force yml ./src/Company/CoreBundle/Resources/config/doctrine

And get metadata in Actors.orm.yml. Class name (main key) in it is "Actors". That's ok because doctrine doesn't know about my intention to call entity class with the name of "Actor". So I edit this file to match my idea.
Then I issue (step2)

php app/console doctrine:mapping:import CompanyCoreBundle yml

and expect main key to be "Company\CoreBundle\Entity\Actor" but it is "Company\CoreBundle\Entity\Actors".
And when I call (step3)

php app/console doctrine:generate:entities CompanyCoreBundle

I get resulting entity class with the wrong name.
If I try to rename file before step2 or class name (main key) before step3 I get errors like

Notice: Undefined index: Company\CoreBundle\Entity\Actor

It would be great if you change this behaviour or clarify it in the corresponding documentation.

Thanks