10000 Update doctrine.rst · symfony/symfony-docs@c1b7aec · GitHub
[go: up one dir, main page]

Skip to content

Commit c1b7aec

Browse files
hectorpratswouterj
authored andcommitted
Update doctrine.rst
1 parent 86eca87 commit c1b7aec

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