1
0
mirror of synced 2024-12-05 03:06:05 +03:00

Merge pull request #1355 from scaytrase/patch-1

[Docs] TablePrefix example - Check for being the owning side
This commit is contained in:
Marco Pivetta 2015-04-02 20:31:27 +01:00
commit 014d554c28

View File

@ -45,8 +45,8 @@ appropriate autoloaders.
}
foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) {
if ($mapping['type'] == \Doctrine\ORM\Mapping\ClassMetadataInfo::MANY_TO_MANY) {
$mappedTableName = $classMetadata->associationMappings[$fieldName]['joinTable']['name'];
if ($mapping['type'] == \Doctrine\ORM\Mapping\ClassMetadataInfo::MANY_TO_MANY && $mapping['isOwningSide']) {
$mappedTableName = $mapping['joinTable']['name'];
$classMetadata->associationMappings[$fieldName]['joinTable']['name'] = $this->prefix . $mappedTableName;
}
}