Zend Framework 2 and Doctrine 2 - Configuration for multiple databases

后端 未结 3 1542
独厮守ぢ
独厮守ぢ 2021-01-03 07:24

I pasted the code from the configuration.md file to

module.config.php

\'doctrine\' => array(
        \'connection\' => array(
            \'orm         


        
3条回答
  •  南笙
    南笙 (楼主)
    2021-01-03 07:32

    @edigu answer works perfectly fine but in some cases, it gives "Following error: Zend\ServiceManager\ServiceManager:: get was unable to fetch or create an instance for doctrine.connection.orm_crawle"

    So to resolve this we may change in the Entity Manager settings

    'entitymanager' => array(
            'orm_default' => array(
                'connection'    => 'orm_default',
                'configuration' => 'orm_default',
            ),
            'orm_alternative' => array(
                'connection'    => 'orm_alternative',
                'configuration' => 'orm_default',  //<--use parent configurations 
            ),
        ),
    

    for refernece check here

提交回复
热议问题