问题
Symfony newbie here! I installed Symfony and I made a controller and an action and some html is displayed properly. So, Symfony is working fine. I have a problem creating entity tables in the database. I created some entities using (annotations and some other way of making those - I tried couple of different ways of making entities through console, with same result). To create entities I used:
php app/console doctrine:generate:entity
And then, when I try to flush it to the database (in order to create the table(s)), I use this command:
php app/console doctrine:schema:update --force
After running that command, I get this error, and - just as I expected - the tables are not created:
I tried to clear the symfony cache.
I checked AppBundle is registered in AppKernel.
I checked that auto mapping is set to true in entity manager.
What am I missing here? To remind you, I have just installed a fresh Symfony and did the steps I described above. I appreciate your help since I really need this because I want to learn Symfony.
回答1:
I deleted whole bundle, and created bundle through console, and then created tables through console, and this time it worked. I still don't know what was wrong with my previous setting(s) of Symfony.
回答2:
Make sure in your config.yml(app/config.config.yml) you have configured your doctrine->orm->auto_mapping => true.
doctrine:
dbal:
----
----
orm:
----
----
auto_mapping: true
来源:https://stackoverflow.com/questions/39257806/error-no-metadata-classes-to-process-when-generating-db-tables-in-symfony-us