From 987834a2ddd3b746c9d63c92dd68f30cdc43a6db Mon Sep 17 00:00:00 2001 From: "Fabio B. Silva" Date: Fri, 13 Apr 2012 09:13:18 -0300 Subject: [PATCH] wrap lines --- en/reference/namingstrategy.rst | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/en/reference/namingstrategy.rst b/en/reference/namingstrategy.rst index 9963fc798..f1e856b58 100644 --- a/en/reference/namingstrategy.rst +++ b/en/reference/namingstrategy.rst @@ -1,9 +1,11 @@ Implementing a NamingStrategy ============================== -Using a naming strategy you can provide rules for automatically generating database identifiers, columns and tables names +Using a naming strategy you can provide rules for automatically generating +database identifiers, columns and tables names when the table/column name is not given. -This feature helps reduce the verbosity of the mapping document, eliminating repetitive noise (eg: ``TABLE_``). +This feature helps reduce the verbosity of the mapping document, +eliminating repetitive noise (eg: ``TABLE_``). Configuring a naming strategy @@ -24,20 +26,23 @@ You can specify a different strategy by calling ``Doctrine\ORM\Configuration#set Underscore naming strategy --------------------------- -``\Doctrine\ORM\Mapping\UnderscoreNamingStrategy`` is a built-in strategy that might be a useful if you want to use a underlying convention. +``\Doctrine\ORM\Mapping\UnderscoreNamingStrategy`` is a built-in strategy +that might be a useful if you want to use a underlying convention. .. code-block:: php setNamingStrategy(namingStrategy); + $configuration()->setNamingStrategy($namingStrategy); -Then SomeEntityName will generate the table SOME_ENTITY_NAME when CASE_UPPER or some_entity_name using CASE_LOWER is given. +Then SomeEntityName will generate the table SOME_ENTITY_NAME when CASE_UPPER +or some_entity_name using CASE_LOWER is given. Naming strategy interface ------------------------- -The interface ``Doctrine\ORM\Mapping\NamingStrategy`` allows you to specify a "naming standard" for database tables and columns. +The interface ``Doctrine\ORM\Mapping\NamingStrategy`` allows you to specify +a "naming standard" for database tables and columns. .. code-block:: php @@ -94,7 +99,9 @@ The interface ``Doctrine\ORM\Mapping\NamingStrategy`` allows you to specify a "n Implementing a naming strategy ------------------------------- -If you have database naming standards like all tables names should be prefixed by the application prefix, all column names should be upper case, you can easily achieve such standards by implementing a naming strategy. +If you have database naming standards like all tables names should be prefixed +by the application prefix, all column names should be upper case, +you can easily achieve such standards by implementing a naming strategy. You need to implements NamingStrategy first. Following is an example