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

Check for the being owning side

* Small fix do get rid of notice `undefined index 'joinTable'` as the inverse side does not declare `joinTable` at all.
* Shortened access to `$classMetadata->associationMappings[$fieldName]` for read accesses to increase readability
This commit is contained in:
Pavel Batanov 2015-04-01 14:55:52 +03:00
parent 61bcfda167
commit ac70c18d50

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;
}
}