Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid Argument Exception when generating Entities from existing database

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?

like image 729
Joseph Woodward Avatar asked Jan 18 '13 23:01

Joseph Woodward


1 Answers

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

like image 56
Joseph Woodward Avatar answered Nov 01 '22 18:11

Joseph Woodward