From d579eeabad6796c43d51683a0cfc902d89cd2a44 Mon Sep 17 00:00:00 2001 From: LavaSlider Date: Thu, 20 Dec 2018 10:40:18 -0500 Subject: [PATCH 1/2] Add Doctrine ORM installation instructions. This best practices page assumes Doctrine is available and, since it is not, the reader is given a little extra information and a link to know how to make it available and be able to continue through the rest of the examples. This makes it consistent with the Data Fixtures description later on the page. --- best_practices/business-logic.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/best_practices/business-logic.rst b/best_practices/business-logic.rst index d4da19721a8..574f8e9cbb6 100644 --- a/best_practices/business-logic.rst +++ b/best_practices/business-logic.rst @@ -191,6 +191,15 @@ library or strategy you want for this. In practice, many Symfony applications rely on the independent `Doctrine project`_ to define their model using entities and repositories. + +Doctrine support is not enabled by default in Symfony. So to use Doctrine +as shown in the examples below you will need to install `Doctrine ORM support`_ +by executing the following command: + +.. code-block:: terminal + + $ composer require "symfony/orm-pack" + Just like with business logic, we recommend storing Doctrine entities in the AppBundle. @@ -357,6 +366,7 @@ Next: :doc:`/best_practices/controllers` .. _`full definition`: https://en.wikipedia.org/wiki/Business_logic .. _`Doctrine project`: http://www.doctrine-project.org/ +.. _`Doctrine ORM support`: https://symfony.com/doc/current/doctrine.html .. _`fixture class`: https://symfony.com/doc/current/bundles/DoctrineFixturesBundle/index.html#writing-simple-fixtures .. _`PSR-1`: https://www.php-fig.org/psr/psr-1/ .. _`PSR-2`: https://www.php-fig.org/psr/psr-2/ From 6d164c34f84fa4905892c858cc33ea691b09edb1 Mon Sep 17 00:00:00 2001 From: Yanick Witschi Date: Sun, 7 Apr 2019 10:24:22 +0200 Subject: [PATCH 2/2] Addressed issues raised in (#10798) --- best_practices/business-logic.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/best_practices/business-logic.rst b/best_practices/business-logic.rst index 574f8e9cbb6..a3ee57a8f69 100644 --- a/best_practices/business-logic.rst +++ b/best_practices/business-logic.rst @@ -193,12 +193,12 @@ In practice, many Symfony applications rely on the independent `Doctrine project`_ to define their model using entities and repositories. Doctrine support is not enabled by default in Symfony. So to use Doctrine -as shown in the examples below you will need to install `Doctrine ORM support`_ +as shown in the examples below you will need to install :doc:`Doctrine ORM support ` by executing the following command: .. code-block:: terminal - $ composer require "symfony/orm-pack" + $ composer require symfony/orm-pack Just like with business logic, we recommend storing Doctrine entities in the AppBundle. @@ -310,7 +310,7 @@ the following command to install the Doctrine fixtures bundle: .. code-block:: terminal - $ composer require "doctrine/doctrine-fixtures-bundle" + $ composer require doctrine/doctrine-fixtures-bundle Then, enable the bundle in ``AppKernel.php``, but only for the ``dev`` and ``test`` environments::