Skip to content

clarify how to use custom entity manager names #10827

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion doctrine/multiple_entity_managers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,25 @@ and ``customer``. The ``default`` entity manager manages entities in the
entities in ``src/Entity/Customer``. You've also defined two connections, one
for each entity manager.

.. note::
.. caution::

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

If you use a different name than ``default`` for the default entity manager,
you will need to redefine the default entity manager in ``prod`` environment
configuration too:

.. code-block:: yaml

# config/packages/prod/doctrine.yaml
doctrine:
orm:
default_entity_manager: 'your default entity manager name'

# ...

When working with multiple connections to create your databases:

.. code-block:: terminal
Expand Down