1
0
mirror of synced 2025-02-02 13:31:45 +03:00

Updated table/column names example to be lowercase

This commit is contained in:
Dan Barrett 2017-12-11 12:14:39 +11:00 committed by GitHub
parent bccc46dc12
commit cd00ccae69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()));
}
}