2013-01-18 11 views
5

私はSymfony 2プロジェクトをPropelからDoctrineに変換し、既存のデータベースをDoctrine Entitiesに変換したいと考えています。既存のデータベースからエンティティを生成する際に無効な引数例外

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. 

誰がどこで説明することができ、私は、次のコマンドを実行したときしかし、私はtutorial on the Symfony websiteを以下のよこれを行うには

私は間違っていると私はこれを修正する方法を行く?

答えて

9

最後に、エラーの原因を突き止めました。 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

関連する問題