“Class XXX is not a valid entity or mapped super class” after moving the class in the filesystem

前端 未结 12 1206
悲哀的现实
悲哀的现实 2020-12-01 08:51

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

12条回答
  •  醉酒成梦
    2020-12-01 09:20

    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
    

提交回复
热议问题