从现有数据库生成实体时出现无效参数异常

5
我正在将一个Symfony 2项目从Propel转换为Doctrine,并希望将现有数据库转换为Doctrine实体。
为此,我正在遵循Symfony网站上的教程,但是当我运行以下命令时: php app/console doctrine:mapping:convert xml ./src/Acme/BlogBundle/Resources/config/doctrine/metadata/orm --from-database --force 我立即收到以下错误:
[InvalidArumentException]
Doctrine ORM Manager named "" does not exist.

有人能解释一下我错在哪里,以及我该如何修复这个问题吗?

1个回答

8

终于找出导致错误的原因了。看起来config.yml中的doctrine配置设置需要一个名为auto_mapping: true的参数。

例如:

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

更多信息可以在这里找到:http://symfony.com/doc/2.0/reference/configuration/doctrine.html


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接