I had an entity class in Aib\\PlatformBundle\\Entity\\User.php
I had no problems trying to create its form class through
php app/ console doc
big thx to Mark Fu and mogoman
I knew it had to be somewhere in the config.yml... and being able to test it against the
app/console doctrine:mapping:info
really helped!
In fact, this command just simply stops at an error... no feedback, but when everything is fine you should be able to see all your entities listed.
Do check your config.yml file, should be containing something like this:
# Doctrine Configuration
doctrine:
dbal:
driver: %database_driver%
host: %database_host%
port: %database_port%
dbname: %database_name%
user: %database_user%
password: %database_password%
charset: UTF8
types:
json: Sonata\Doctrine\Types\JsonType
orm:
auto_generate_proxy_classes: %kernel.debug%
# auto_mapping: true
entity_managers:
default:
mappings:
FOSUserBundle: ~
# ApplicationSonataUserBundle: ~
YourUserBundle: ~
SonataUserBundle: ~
Add your own bundle to the mappings list.
In my case on my mac I was using src/MainBundle/Resource/Config/Doctrine, of course it worked on Mac but it didn't work on production Ubuntu server. Once renamed Config to config and Doctrine to doctrine, the mapping files were found and it started working.
In my case, I was too zealous during a refactor and had deleted a doctrine yml file!
I got rid of the same error message as in your case by using app/console_dev instead of just app/console
Had this problem yesterday and found this thread. I created the entity with the mapping in a new bundle (e.g. MyFooBundle/Entity/User.php), did all the configuration according to the docs but got the same error from above when trying to load the app.
In the end I realized that I wasn't loading MyFooBundle in AppKernel:
new My\FooBundle\MyFooBundle()
A great way to debug this is to run this command:
app/console doctrine:mapping:info