How to inject non-default entity managers?

前端 未结 4 798
太阳男子
太阳男子 2020-12-28 19:01

In Symfony2 you can work with multiple entity managers and use something like the code below:

$em = $this->get(\'doctrine\')->getManager();
$em = $this         


        
4条回答
  •  清酒与你
    2020-12-28 20:03

    If your entity managers config name is non_default then you can reference it as @doctrine.orm.non_default_entity_manager

提交回复
热议问题