Skip to content

Commit d376c72

Browse files
Adding a tip on using doctrine as a service
1 parent 1808c41 commit d376c72

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

book/doctrine.rst

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ for you:
111111
[mysqld]
112112
collation-server = utf8_general_ci
113113
character-set-server = utf8
114-
114+
115115
Using SQLite
116116
~~~~~~~~~~~~
117-
117+
118118
If you want to use SQLite as your database, you need to set the path
119119
where your database file should be stored:
120120

@@ -354,8 +354,8 @@ doesn't replace your existing methods).
354354

355355
.. caution::
356356

357-
Keep in mind that Doctrine's entity generator produces simple getters/setters.
358-
You should check generated entities and adjust getter/setter logic to your own
357+
Keep in mind that Doctrine's entity generator produces simple getters/setters.
358+
You should check generated entities and adjust getter/setter logic to your own
359359
needs.
360360

361361
.. sidebar:: More about ``doctrine:generate:entities``
@@ -1448,6 +1448,16 @@ Some notable or interesting tasks include:
14481448
read the ":doc:`/bundles/DoctrineFixturesBundle/index`" entry of the
14491449
documentation.
14501450

1451+
.. tip::
1452+
1453+
This page shows working with Doctrine within a controller. You may also
1454+
want to work with Doctrine elsewhere in your application. The
1455+
:method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::getDoctrine`
1456+
method of the controller returns the ``doctrine`` service, you can work with
1457+
this in the same way elsewhere by injecting this into your own
1458+
services. See :doc:`/book/service_container` for more on creating
1459+
your own services.
1460+
14511461
Summary
14521462
-------
14531463

0 commit comments

Comments
 (0)