From bccc46dc125e4e6a05e43271389579ab4254b705 Mon Sep 17 00:00:00 2001 From: Dan Barrett Date: Wed, 1 Nov 2017 16:40:04 +1100 Subject: [PATCH 1/2] Corrected demo code to match example Example paragraph mentions changing column titles to upper case, yet `strtolower` was being used. --- docs/en/reference/namingstrategy.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/reference/namingstrategy.rst b/docs/en/reference/namingstrategy.rst index fff5e601a89..b81872fd07a 100644 --- a/docs/en/reference/namingstrategy.rst +++ b/docs/en/reference/namingstrategy.rst @@ -126,12 +126,12 @@ You need to create a class which implements ``Doctrine\ORM\Mapping\NamingStrateg } public function joinTableName($sourceEntity, $targetEntity, $propertyName = null) { - return strtolower($this->classToTableName($sourceEntity) . '_' . + return strtoupper($this->classToTableName($sourceEntity) . '_' . $this->classToTableName($targetEntity)); } public function joinKeyColumnName($entityName, $referencedColumnName = null) { - return strtolower($this->classToTableName($entityName) . '_' . + return strtoupper($this->classToTableName($entityName) . '_' . ($referencedColumnName ?: $this->referenceColumnName())); } } From cd00ccae694c6c8f40414734f704535ffb78b294 Mon Sep 17 00:00:00 2001 From: Dan Barrett Date: Mon, 11 Dec 2017 12:14:39 +1100 Subject: [PATCH 2/2] Updated table/column names example to be lowercase --- docs/en/reference/namingstrategy.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/en/reference/namingstrategy.rst b/docs/en/reference/namingstrategy.rst index b81872fd07a..23aa573534c 100644 --- a/docs/en/reference/namingstrategy.rst +++ b/docs/en/reference/namingstrategy.rst @@ -97,7 +97,7 @@ a naming strategy for database tables and columns. Implementing a naming strategy ------------------------------- If you have database naming standards, like all table names should be prefixed -by the application prefix, all column names should be upper case, you can easily +by the application prefix, all column names should be lower case, you can easily achieve such standards by implementing a naming strategy. You need to create a class which implements ``Doctrine\ORM\Mapping\NamingStrategy``. @@ -126,12 +126,12 @@ You need to create a class which implements ``Doctrine\ORM\Mapping\NamingStrateg } public function joinTableName($sourceEntity, $targetEntity, $propertyName = null) { - return strtoupper($this->classToTableName($sourceEntity) . '_' . + return strtolower($this->classToTableName($sourceEntity) . '_' . $this->classToTableName($targetEntity)); } public function joinKeyColumnName($entityName, $referencedColumnName = null) { - return strtoupper($this->classToTableName($entityName) . '_' . + return strtolower($this->classToTableName($entityName) . '_' . ($referencedColumnName ?: $this->referenceColumnName())); } }