8000 Merge branch '4.3' into 4.4 · symfony/symfony-docs@cf407e1 · GitHub
[go: up one dir, main page]

Skip to content

Commit cf407e1

Browse files
committed
Merge branch '4.3' into 4.4
* 4.3: [#12393] Rewrote the sentence a bit Update doctrine.rst
2 parents 211503e + 93ef5f2 commit cf407e1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

reference/configuration/doctrine.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,13 @@ 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. In a controller
159+
extending ``AbstractController``, you can access it directly using the
160+
``getConnection()`` method and the name of the connection::
161+
162+
$connection = $this->getDoctrine()->getConnection('customer');
163+
164+
$result = $connection->fetchAll('SELECT name FROM customer');
159165

160166
Doctrine ORM Configuration
161167
--------------------------

0 commit comments

Comments
 (0)
0