We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 294a08d commit 81e0bdcCopy full SHA for 81e0bdc
doctrine/multiple_entity_managers.rst
@@ -254,6 +254,17 @@ the default entity manager (i.e. ``default``) is returned::
254
}
255
256
257
+You can leverage the service binding feature to reference the ``customer``
258
+entity manager so that you can inject it directly::
259
+
260
+ services:
261
+ _defaults:
262
+ bind:
263
+ $customerEntityManager: '@doctrine.orm.customer_entity_manager'
264
265
+Now typehint your method with `EntityManagerInterface $customerEntityManager`
266
+to inject this second entity manager.
267
268
You can now use Doctrine like you did before - using the ``default`` entity
269
manager to persist and fetch entities that it manages and the ``customer``
270
entity manager to persist and fetch its entities.
0 commit comments