From 83b509e033f994e3dfbe373b26ff45816ff33cd3 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Tue, 31 Jul 2012 23:26:40 +0200 Subject: [PATCH] Move again into tools --- en/reference/configuration.rst | 46 ---------------------------------- en/reference/tools.rst | 46 ++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/en/reference/configuration.rst b/en/reference/configuration.rst index 415659733..65d047b8b 100644 --- a/en/reference/configuration.rst +++ b/en/reference/configuration.rst @@ -588,49 +588,3 @@ In general the required code looks like this: Doctrine\ORM\Tools\Console\ConsoleRunner::addCommands($cli); $cli->run(); -Runtime vs Development Mapping Validation ------------------------------------------ - -For performance reasons Doctrine 2 has to skip some of the -necessary validation of metadata mappings. You have to execute -this validation in your development workflow to verify the -associations are correctly defined. - -You can either use the Doctrine Command Line Tool: - -.. code-block:: php - - doctrine orm:validate-schema - -Or you can trigger the validation manually: - -.. code-block:: php - - validateMapping(); - - if (count($errors) > 0) { - // Lots of errors! - echo implode("\n\n", $errors); - } - -If the mapping is invalid the errors array contains a positive -number of elements with error messages. - -.. warning:: - - One mapping option that is not validated is the use of the referenced column name. - It has to point to the equivalent primary key otherwise Doctrine will not work. - -.. note:: - - One common error is to use a backlash in front of the - fully-qualified class-name. Whenever a FQCN is represented inside a - string (such as in your mapping definitions) you have to drop the - prefix backslash. PHP does this with ``get_class()`` or Reflection - methods for backwards compatibility reasons. - - diff --git a/en/reference/tools.rst b/en/reference/tools.rst index 6f01b0527..c028bf1f5 100644 --- a/en/reference/tools.rst +++ b/en/reference/tools.rst @@ -434,6 +434,52 @@ You can also reverse engineer a database using the a useful domain model. +Runtime vs Development Mapping Validation +----------------------------------------- + +For performance reasons Doctrine 2 has to skip some of the +necessary validation of metadata mappings. You have to execute +this validation in your development workflow to verify the +associations are correctly defined. + +You can either use the Doctrine Command Line Tool: + +.. code-block:: php + + doctrine orm:validate-schema + +Or you can trigger the validation manually: + +.. code-block:: php + + validateMapping(); + + if (count($errors) > 0) { + // Lots of errors! + echo implode("\n\n", $errors); + } + +If the mapping is invalid the errors array contains a positive +number of elements with error messages. + +.. warning:: + + One mapping option that is not validated is the use of the referenced column name. + It has to point to the equivalent primary key otherwise Doctrine will not work. + +.. note:: + + One common error is to use a backlash in front of the + fully-qualified class-name. Whenever a FQCN is represented inside a + string (such as in your mapping definitions) you have to drop the + prefix backslash. PHP does this with ``get_class()`` or Reflection + methods for backwards compatibility reasons. + + Adding own commands -------------------