在我的配置中,我声明了2个连接:
doctrine:
dbal:
default_connection: pay
connections:
pay:
driver: %database_driver%
host: %database_host%
port: %database_port%
dbname: %database_name%
user: %database_user%
password: %database_password%
charset: UTF8
mein:
driver: %database_driver%
host: somehost
port: 3306
dbname: dbname
user: dbuser
password: dbpassword
charset: UTF8
没有任何参数的getEntityManager()工作正常,但如果我将使用'pay'或'mein',则说明显示错误“名称%name%的EntityManager不存在。”
修改Registry.php
public function getEntityManager($name = null)
{
var_dump($this->entityManagers);die;
返回
array(1) { ["default"]=> string(35) "doctrine.orm.default_entity_manager" }
为什么它看不到实际的配置?