Search code examples
symfonydoctrinesonata-admin

Symfony error when i copy my project


I'm working on a project using Symfony 2.6 and Sonata Admin Bundle. It works on my computer (win10 - wamp - mysql) but when i copy it on another computer with same configuration (win10 - wamp - mysql). It return for every class in sonata admin : No entity manager defined for class "xxx"

enter image description here

I do not figure out what's the error since nothing change between the version on my computer and the one on the other computer. i'm searching since 1 week and found no solution for my problem..

all helps would be welcome

ps : i found that when i run the following command :"php app/console doctrine:mapping:info"

My Bundle "AppBundle" isn't listed in the mapping.

see:enter image description here

How do i map my AppBundle for this ?

Following command : "php app/console doctrine:generate:entities AppBundle"

return me this :

"Bundle "AppBundle" does not contain any mapped entities."


Solution

  • Try the following commands, but before running the third one you should copy your entities files (not sure if an automatic copy is generated for each entity), because in case there is some custom method/property in it, this will maybe overwrite them.

    1. php app/console doctrine:mapping:import --force AppBundle yml
    2. php app/console doctrine:mapping:convert annotation ./src --force
    3. php app/console doctrine:generate:entities AppBundle