From d376c7273c5035544a889c3635c146a6b2c238d5 Mon Sep 17 00:00:00 2001 From: Richard Miller Date: Mon, 11 Feb 2013 21:11:37 +0000 Subject: [PATCH] Adding a tip on using doctrine as a service --- book/doctrine.rst | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/book/doctrine.rst b/book/doctrine.rst index 19703b3b1f9..87bbc6ac514 100644 --- a/book/doctrine.rst +++ b/book/doctrine.rst @@ -111,10 +111,10 @@ for you: [mysqld] collation-server = utf8_general_ci character-set-server = utf8 - + Using SQLite ~~~~~~~~~~~~ - + If you want to use SQLite as your database, you need to set the path where your database file should be stored: @@ -354,8 +354,8 @@ doesn't replace your existing methods). .. caution:: - Keep in mind that Doctrine's entity generator produces simple getters/setters. - You should check generated entities and adjust getter/setter logic to your own + Keep in mind that Doctrine's entity generator produces simple getters/setters. + You should check generated entities and adjust getter/setter logic to your own needs. .. sidebar:: More about ``doctrine:generate:entities`` @@ -1448,6 +1448,16 @@ Some notable or interesting tasks include: read the ":doc:`/bundles/DoctrineFixturesBundle/index`" entry of the documentation. +.. tip:: + + This page shows working with Doctrine within a controller. You may also + want to work with Doctrine elsewhere in your application. The + :method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::getDoctrine` + method of the controller returns the ``doctrine`` service, you can work with + this in the same way elsewhere by injecting this into your own + services. See :doc:`/book/service_container` for more on creating + your own services. + Summary -------