5

我正在将一个 Symfony 2 项目从 Propel 转换为 Doctrine,并希望将现有数据库转换为 Doctrine Entities。

为此,我遵循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.

谁能解释我哪里出了问题以及我如何解决这个问题?

4

1 回答 1

8

终于查明是什么导致了错误。似乎 config.yml 中的教义配置设置需要一个名为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

于 2013-01-19T01:39:46.747 回答