Invalid Argument Exception when generating Entitie

2019-06-22 06:59发布

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条回答
看我几分像从前
2楼-- · 2019-06-22 07:54

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

查看更多
登录 后发表回答