Skip to content

Commit a95163e

Browse files
authored
Update doctrine.rst
Uploading code of directly access in controller of the custom dbal connections.
1 parent 86eca87 commit a95163e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

reference/configuration/doctrine.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,12 @@ 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+
.. code-block:: php
162+
$conex = $this->getDoctrine()->getConnection('customer');
163+
$res = $conex->fetchAll('select * from table');
159164
160165
Doctrine ORM Configuration
161166
--------------------------

0 commit comments

Comments
 (0)