From d22059c96bbac52fc6f1604ada9c170959020e7e Mon Sep 17 00:00:00 2001 From: Chase Noel Date: Tue, 26 Oct 2021 14:47:09 -0400 Subject: [PATCH 1/6] Add doctrine/dbal to project composer.json As discussed in https://github.com/doctrine/orm/issues/9078 when entities utilize data mappings which are provided by the dbal lib it is expected behavior that users will explicitly define their dependency on the package. --- docs/en/tutorials/getting-started.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/en/tutorials/getting-started.rst b/docs/en/tutorials/getting-started.rst index 1cb108668ca..61731a0f2fd 100644 --- a/docs/en/tutorials/getting-started.rst +++ b/docs/en/tutorials/getting-started.rst @@ -81,7 +81,8 @@ that directory with the following contents: { "require": { - "doctrine/orm": "^2.6.2", + "doctrine/orm": "^2.10.2", + "doctrine/dbal": "^3.1.1", "symfony/yaml": "2.*", "symfony/cache": "^5.3" }, @@ -112,6 +113,8 @@ Add the following directories: .. note:: The YAML driver is deprecated and will be removed in version 3.0. It is strongly recommended to switch to one of the other mappings. +.. note:: + When using the entity data mapping it is best practice to explicity specify the version of doctrine/dbal in your composer.json. This helps ensure that your entity data mappings remain supported through package upgrades. Obtaining the EntityManager --------------------------- From e8fbcf43028607f5142c36940bf9c6b63e9225f3 Mon Sep 17 00:00:00 2001 From: Chase Noel Date: Tue, 26 Oct 2021 15:58:21 -0400 Subject: [PATCH 2/6] Update docs/en/tutorials/getting-started.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Grégoire Paris --- docs/en/tutorials/getting-started.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/en/tutorials/getting-started.rst b/docs/en/tutorials/getting-started.rst index 61731a0f2fd..4524d065127 100644 --- a/docs/en/tutorials/getting-started.rst +++ b/docs/en/tutorials/getting-started.rst @@ -114,7 +114,10 @@ Add the following directories: The YAML driver is deprecated and will be removed in version 3.0. It is strongly recommended to switch to one of the other mappings. .. note:: - When using the entity data mapping it is best practice to explicity specify the version of doctrine/dbal in your composer.json. This helps ensure that your entity data mappings remain supported through package upgrades. + When using the entity data mapping it is best practice to explicity + specify the version of ``doctrine/dbal`` in your ``composer.json``. + This helps ensure that your entity data mappings remain supported + through package upgrades. Obtaining the EntityManager --------------------------- From 1547d511ffd1fe0e00c314490162ea5f09fd2095 Mon Sep 17 00:00:00 2001 From: Chase Noel Date: Tue, 26 Oct 2021 18:33:11 -0400 Subject: [PATCH 3/6] Used suggested text to make it more clear to people who are new to the project why this is best practice --- docs/en/tutorials/getting-started.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/en/tutorials/getting-started.rst b/docs/en/tutorials/getting-started.rst index 4524d065127..5216adf81ba 100644 --- a/docs/en/tutorials/getting-started.rst +++ b/docs/en/tutorials/getting-started.rst @@ -114,10 +114,13 @@ Add the following directories: The YAML driver is deprecated and will be removed in version 3.0. It is strongly recommended to switch to one of the other mappings. .. note:: - When using the entity data mapping it is best practice to explicity - specify the version of ``doctrine/dbal`` in your ``composer.json``. - This helps ensure that your entity data mappings remain supported - through package upgrades. + It is strongly recommended that you require doctrine/dbal in your + composer.json as well, because using the ORM means mapping objects + and their fields to database tables and their columns, and that + requires mentioning so-called types that are defined in doctrine/dbal + in your application. Having an explicit requirement means you control + when the upgrade to the next major version happens, so that you can + do the necessary changes in your application beforehand. Obtaining the EntityManager --------------------------- From 6d7d4579e54db70cf57302bc70b8865dd56cc81f Mon Sep 17 00:00:00 2001 From: Chase Noel Date: Thu, 28 Oct 2021 16:51:15 -0400 Subject: [PATCH 4/6] Update docs/en/tutorials/getting-started.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Grégoire Paris --- docs/en/tutorials/getting-started.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/tutorials/getting-started.rst b/docs/en/tutorials/getting-started.rst index 5216adf81ba..c0e0c8c220b 100644 --- a/docs/en/tutorials/getting-started.rst +++ b/docs/en/tutorials/getting-started.rst @@ -117,7 +117,7 @@ Add the following directories: It is strongly recommended that you require doctrine/dbal in your composer.json as well, because using the ORM means mapping objects and their fields to database tables and their columns, and that - requires mentioning so-called types that are defined in doctrine/dbal + requires mentioning so-called types that are defined in ``doctrine/dbal`` in your application. Having an explicit requirement means you control when the upgrade to the next major version happens, so that you can do the necessary changes in your application beforehand. From 5069b86782c0ad90de61b1c829d8f3fc67e17065 Mon Sep 17 00:00:00 2001 From: Chase Noel Date: Thu, 28 Oct 2021 16:51:38 -0400 Subject: [PATCH 5/6] Update docs/en/tutorials/getting-started.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Grégoire Paris --- docs/en/tutorials/getting-started.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/tutorials/getting-started.rst b/docs/en/tutorials/getting-started.rst index c0e0c8c220b..201fcf54a0b 100644 --- a/docs/en/tutorials/getting-started.rst +++ b/docs/en/tutorials/getting-started.rst @@ -114,7 +114,7 @@ Add the following directories: The YAML driver is deprecated and will be removed in version 3.0. It is strongly recommended to switch to one of the other mappings. .. note:: - It is strongly recommended that you require doctrine/dbal in your + It is strongly recommended that you require ``doctrine/dbal`` in your composer.json as well, because using the ORM means mapping objects and their fields to database tables and their columns, and that requires mentioning so-called types that are defined in ``doctrine/dbal`` From e512039507948d4b917def494e3cf718495123b1 Mon Sep 17 00:00:00 2001 From: Chase Noel Date: Thu, 28 Oct 2021 16:51:43 -0400 Subject: [PATCH 6/6] Update docs/en/tutorials/getting-started.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Grégoire Paris --- docs/en/tutorials/getting-started.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/tutorials/getting-started.rst b/docs/en/tutorials/getting-started.rst index 201fcf54a0b..3aa79d57ef6 100644 --- a/docs/en/tutorials/getting-started.rst +++ b/docs/en/tutorials/getting-started.rst @@ -115,7 +115,7 @@ Add the following directories: It is strongly recommended to switch to one of the other mappings. .. note:: It is strongly recommended that you require ``doctrine/dbal`` in your - composer.json as well, because using the ORM means mapping objects + ``composer.json`` as well, because using the ORM means mapping objects and their fields to database tables and their columns, and that requires mentioning so-called types that are defined in ``doctrine/dbal`` in your application. Having an explicit requirement means you control