Skip to content

Adding a tip on using doctrine as a service #2234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions book/doctrine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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``
Expand Down Expand Up @@ -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
-------

Expand Down