8000 clarify how to use custom entity manager names · symfony/symfony-docs@1d75482 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1d75482

Browse files
committed
clarify how to use custom entity manager names
1 parent 3d80932 commit 1d75482

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

doctrine/multiple_entity_managers.rst

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,25 @@ and ``customer``. The ``default`` entity manager manages entities in the
186186
entities in ``src/Entity/Customer``. You've also defined two connections, one
187187
for each entity manager.
188188

189-
.. note::
189+
.. caution::
190190

191191
When working with multiple connections and entity managers, you should be
192192
explicit about which configuration you want. If you *do* omit the name of
193193
the connection or entity manager, the default (i.e. ``default``) is used.
194194

195+
If you use a different name than ``default`` for the default entity manager,
196+
you will need to redefine the default entity manager in ``prod`` environment
197+
configuration too:
198+
199+
.. code-block:: yaml
200+
201+
# config/packages/prod/doctrine.yaml
202+
doctrine:
203+
orm:
204+
default_entity_manager: 'your default entity manager name'
205+
206+
# ...
207+
195208
When working with multiple connections to create your databases:
196209

197210 3936
.. code-block:: terminal

0 commit comments

Comments
 (0)
0