From cc065a749b120d6c2ce032a50ffb96c5ef9d42a7 Mon Sep 17 00:00:00 2001 From: dcramble Date: Thu, 4 Oct 2012 16:49:56 -0700 Subject: [PATCH 1/3] Add dbal config example --- .../doctrine/multiple_entity_managers.rst | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/cookbook/doctrine/multiple_entity_managers.rst b/cookbook/doctrine/multiple_entity_managers.rst index 37e89923908..ce4711fb4c2 100644 --- a/cookbook/doctrine/multiple_entity_managers.rst +++ b/cookbook/doctrine/multiple_entity_managers.rst @@ -23,6 +23,26 @@ The following configuration code shows how you can configure two entity managers .. code-block:: yaml doctrine: + dbal: + default_connection: default + connections: + default: + driver: %database_driver% + host: %database_host% + port: %database_port% + dbname: %database_name% + user: %database_user% + password: %database_password% + charset: UTF8 + customer: + driver: %database_driver2% + host: %database_host2% + port: %database_port2% + dbname: %database_name2% + user: %database_user2% + password: %database_password2% + charset: UTF8 + orm: default_entity_manager: default entity_managers: From 9336b633fe0702e4658b07441ec85e69d36c337e Mon Sep 17 00:00:00 2001 From: dcramble Date: Thu, 4 Oct 2012 17:21:57 -0700 Subject: [PATCH 2/3] More updates to language --- .../doctrine/multiple_entity_managers.rst | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/cookbook/doctrine/multiple_entity_managers.rst b/cookbook/doctrine/multiple_entity_managers.rst index ce4711fb4c2..c798af6b465 100644 --- a/cookbook/doctrine/multiple_entity_managers.rst +++ b/cookbook/doctrine/multiple_entity_managers.rst @@ -33,7 +33,7 @@ The following configuration code shows how you can configure two entity managers dbname: %database_name% user: %database_user% password: %database_password% - charset: UTF8 + charset: UTF8 customer: driver: %database_driver2% host: %database_host2% @@ -59,11 +59,25 @@ The following configuration code shows how you can configure two entity managers In this case, you've defined two entity managers and called them ``default`` and ``customer``. The ``default`` entity manager manages entities in the ``AcmeDemoBundle`` and ``AcmeStoreBundle``, while the ``customer`` entity -manager manages entities in the ``AcmeCustomerBundle``. +manager manages entities in the ``AcmeCustomerBundle``. You've also defined +two connections, one for each entity manager. + +.. note:: + + When working with multiple connections and entity managers, you should be + explicit about which configuration you want. If you *do* omit the + connection's or entity manager's name, the default (i.e. ``default``) is used. + + +When working with multiple connections to create your databases:: + + # Play only with "default" connection + php app/console doctrine:database:create + + # Play only with "customer" connection + php app/console doctrine:database:create --connection=customer -When working with multiple entity managers, you should be explicit about which -entity manager you want. If you *do* omit the entity manager's name when you -update your schema, the default (i.e. ``default``) is used:: +When working with multiple entity managers to update your schema:: # Play only with "default" mappings php app/console doctrine:schema:update --force From 195c138cf088c2c0277f2304483ac30e8428bab4 Mon Sep 17 00:00:00 2001 From: dcramble Date: Thu, 4 Oct 2012 17:24:43 -0700 Subject: [PATCH 3/3] More updates --- cookbook/doctrine/multiple_entity_managers.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbook/doctrine/multiple_entity_managers.rst b/cookbook/doctrine/multiple_entity_managers.rst index c798af6b465..92150f9ee5b 100644 --- a/cookbook/doctrine/multiple_entity_managers.rst +++ b/cookbook/doctrine/multiple_entity_managers.rst @@ -65,8 +65,8 @@ two connections, one for each entity manager. .. note:: When working with multiple connections and entity managers, you should be - explicit about which configuration you want. If you *do* omit the - connection's or entity manager's name, the default (i.e. ``default``) is used. + 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. When working with multiple connections to create your databases:: pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy