Invalid Argument Exception when generating Entities from existing database

耗尽温柔 提交于 2019-12-10 13:46:53

问题


I'm converting a Symfony 2 project from Propel to Doctrine and wish to convert the existing database into Doctrine Entities.

To do this I'm following the tutorial on the Symfony website, however when I run the following command:

php app/console doctrine:mapping:convert xml ./src/Acme/BlogBundle/Resources/config/doctrine/metadata/orm --from-database --force

I immediately receive the following error:

[InvalidArumentException]
Doctrine ORM Manager named "" does not exist.

Can anyone explain where I'm going wrong and how I go about fixing this?


回答1:


Finally found out what was causing the error. It appears that the doctrine configuration settings within config.yml require a parameter called auto_mapping: true.

For example:

doctrine:
    dbal:
        driver:   "%database_driver%"
        host:     "%database_host%"
        dbname:   "%database_name%"
        user:     "%database_user%"
        password: "%database_password%"
    orm:
        auto_mapping: true

More information can be found here: http://symfony.com/doc/2.0/reference/configuration/doctrine.html



来源:https://stackoverflow.com/questions/14409342/invalid-argument-exception-when-generating-entities-from-existing-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!