Permalink
Browse files

Table prefix: Duplicated prefix bug fix.

  • Loading branch information...
1 parent ec1e7fd commit 35ba6dae37e8078e4a2f8e0a927f288ecbc0f84f @kayue committed Jul 8, 2012
Showing with 9 additions and 6 deletions.
  1. +9 −6 Subscriber/TablePrefixSubscriber.php
View
15 Subscriber/TablePrefixSubscriber.php
@@ -37,12 +37,15 @@ public function loadClassMetadata(LoadClassMetadataEventArgs $args)
$classMetadata->setTableName($prefix . $classMetadata->getTableName());
- foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) {
- if ($mapping['type'] == \Doctrine\ORM\Mapping\ClassMetadataInfo::MANY_TO_MANY) {
- $mappedTableName = $classMetadata->associationMappings[$fieldName]['joinTable']['name'];
- $classMetadata->associationMappings[$fieldName]['joinTable']['name'] = $prefix . $mappedTableName;
- }
- }
+ // TODO: Looks like we don't need these lines for many to many anymore, it might
+ // result in duplicated table prefix.
+
+ // foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) {
+ // if ($mapping['type'] == \Doctrine\ORM\Mapping\ClassMetadataInfo::MANY_TO_MANY) {
+ // $mappedTableName = $classMetadata->associationMappings[$fieldName]['joinTable']['name'];
+ // $classMetadata->associationMappings[$fieldName]['joinTable']['name'] = $prefix . $mappedTableName;
+ // }
+ // }
}
private function getTablePrefix(LoadClassMetadataEventArgs $args)

0 comments on commit 35ba6da

Please sign in to comment.