从bundle配置Mongo DB映射

时间:2016-08-19 17:29:42

标签: mongodb symfony bundle

我正在尝试设置一个捆绑包,该捆绑包将提供捆绑中实体映射的配置。

我要做的是以下内容:

#app/config/config.yml
doctrine_mongodb:
    connections:
         default:
            server: "%mongodb_server%"
            options: {}
    default_database: questions
    document_managers:
        default: ~

然后在捆绑中:

doctrine_mongodb:
    document_managers:
        default:
            mappings:
                TwoBitQuestionnaireBundle:
                    type: yml
                    prefix: TwoBit\Questionnaires\Model

我希望这会有效,但我得到了这个错误:

InvalidArgumentException in YamlFileLoader.php line 404:
There is no extension able to load the configuration for "doctrine_mongodb" 
(in /home/vagrant/sites/questions/src/TwoBit/QuestionnaireBundle/DependencyInjection/../Resources/config/config.yml). 
Looked for namespace "doctrine_mongodb", found none

0 个答案:

没有答案