8000 minor #12393 Update doctrine.rst (hectorprats) · symfony/symfony-docs@65c4dfd · GitHub
[go: up one dir, main page]

Skip to content

Commit 65c4dfd

Browse files
committed
minor #12393 Update doctrine.rst (hectorprats)
This PR was squashed before being merged into the 4.3 branch (closes #12393). Discussion ---------- Update doctrine.rst Uploading code of directly access in controller of the custom dbal connections. <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- c1b7aec Update doctrine.rst
2 parents 2baeb1c + c1b7aec commit 65c4dfd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

reference/configuration/doctrine.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ which is the first one defined or the one configured via the
155155
``default_connection`` parameter.
156156

157157
Each connection is also accessible via the ``doctrine.dbal.[name]_connection``
158-
service where ``[name]`` is the name of the connection.
158+
service where ``[name]`` is the name of the connection. Or directly in the controller with
159+
getConnection method and the name of the connection::
160+
161+
$connection = $this->getDoctrine()->getConnection('customer');
162+
$result = $connection->fetchAll('select name from customer');
159163

160164
Doctrine ORM Configuration
161165
--------------------------

0 commit comments

Comments
 (0)
0