From cef3cd85ab363aac9cea04199e2b7e56b2c2044e Mon Sep 17 00:00:00 2001 From: Gianluca Farinelli Date: Thu, 3 Jan 2019 17:37:20 +0100 Subject: [PATCH 1/4] Fix classes generation with YAML or XML metadata. --- doctrine/reverse_engineering.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doctrine/reverse_engineering.rst b/doctrine/reverse_engineering.rst index 761b2694af2..a454d2cafaa 100644 --- a/doctrine/reverse_engineering.rst +++ b/doctrine/reverse_engineering.rst @@ -85,6 +85,24 @@ run: // generates getter/setter methods $ php bin/console make:entity --regenerate App +If you generated XML or YAML metadata you have also to change the ``config/packages/doctrine.yaml`` +file like this (the example is for YAML): + +.. code-block:: yaml + + + doctrine: + ... + orm: + ... + mappings: + App: + is_bundle: false + type: yml # Previously was 'annotation' + dir: '%kernel.project_dir%/config/doctrine' # Previously was '%kernel.project_dir%/src/Entity' + prefix: 'App\Entity' + alias: App + .. note:: If you want to have a OneToMany relationship, you will need to add From da0807a36ddf9c1ae950565e4936bc65296eaf64 Mon Sep 17 00:00:00 2001 From: Gianluca Farinelli Date: Wed, 9 Jan 2019 12:33:22 +0100 Subject: [PATCH 2/4] FIX: rst conventions fix. --- doctrine/reverse_engineering.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doctrine/reverse_engineering.rst b/doctrine/reverse_engineering.rst index a454d2cafaa..980c54f4831 100644 --- a/doctrine/reverse_engineering.rst +++ b/doctrine/reverse_engineering.rst @@ -90,11 +90,10 @@ file like this (the example is for YAML): .. code-block:: yaml - doctrine: - ... + # ... orm: - ... + # ... mappings: App: is_bundle: false From 73859ab49b5f41f8287d54c2bd570389226c4435 Mon Sep 17 00:00:00 2001 From: Gianluca Farinelli Date: Thu, 10 Jan 2019 10:46:42 +0100 Subject: [PATCH 3/4] INFO: Moved config changes into tip. --- doctrine/reverse_engineering.rst | 33 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/doctrine/reverse_engineering.rst b/doctrine/reverse_engineering.rst index 980c54f4831..0e640c77cce 100644 --- a/doctrine/reverse_engineering.rst +++ b/doctrine/reverse_engineering.rst @@ -70,6 +70,22 @@ files: ``BlogPost.php`` and ``BlogComment.php``. $ php bin/console doctrine:mapping:import 'App\Entity' xml --path=config/doctrine + In this case, make sure to adapt your mapping configuration accordingly: + + .. code-block:: yaml + + doctrine: + # ... + orm: + # ... + mappings: + App: + is_bundle: false + type: yml # Set to xml in case of XML mapping + dir: '%kernel.project_dir%/config/doctrine' + prefix: 'App\Entity' + alias: App + Generating the Getters & Setters or PHP Classes ----------------------------------------------- @@ -85,23 +101,6 @@ run: // generates getter/setter methods $ php bin/console make:entity --regenerate App -If you generated XML or YAML metadata you have also to change the ``config/packages/doctrine.yaml`` -file like this (the example is for YAML): - -.. code-block:: yaml - - doctrine: - # ... - orm: - # ... - mappings: - App: - is_bundle: false - type: yml # Previously was 'annotation' - dir: '%kernel.project_dir%/config/doctrine' # Previously was '%kernel.project_dir%/src/Entity' - prefix: 'App\Entity' - alias: App - .. note:: If you want to have a OneToMany relationship, you will need to add From eaa156ce830ef265d17f196bf27d31da37a4de43 Mon Sep 17 00:00:00 2001 From: Gianluca Farinelli Date: Fri, 11 Jan 2019 12:21:53 +0100 Subject: [PATCH 4/4] FIX: Added config file reference. --- doctrine/reverse_engineering.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doctrine/reverse_engineering.rst b/doctrine/reverse_engineering.rst index 0e640c77cce..ae446e33140 100644 --- a/doctrine/reverse_engineering.rst +++ b/doctrine/reverse_engineering.rst @@ -74,6 +74,7 @@ files: ``BlogPost.php`` and ``BlogComment.php``. .. code-block:: yaml + # config/packages/doctrine.yaml doctrine: # ... orm: