Merge pull request #63 from chesteroni/master
Added missing checks for associatation indexes
This commit is contained in:
commit
3cdff65761
@ -121,21 +121,29 @@ class PhpExporter extends AbstractExporter
|
|||||||
$associationMappingArray = array_merge($associationMappingArray, $oneToOneMappingArray);
|
$associationMappingArray = array_merge($associationMappingArray, $oneToOneMappingArray);
|
||||||
} else if ($associationMapping['type'] == ClassMetadataInfo::ONE_TO_MANY) {
|
} else if ($associationMapping['type'] == ClassMetadataInfo::ONE_TO_MANY) {
|
||||||
$method = 'mapOneToMany';
|
$method = 'mapOneToMany';
|
||||||
$oneToManyMappingArray = array(
|
$potentialAssociationMappingIndexes = array(
|
||||||
'mappedBy' => $associationMapping['mappedBy'],
|
'mappedBy',
|
||||||
'orphanRemoval' => $associationMapping['orphanRemoval'],
|
'orphanRemoval',
|
||||||
'orderBy' => $associationMapping['orderBy']
|
'orderBy',
|
||||||
);
|
);
|
||||||
|
foreach ($potentialAssociationMappingIndexes as $index) {
|
||||||
|
if (isset($associationMapping[$index])) {
|
||||||
|
$oneToManyMappingArray[$index] = $associationMapping[$index];
|
||||||
|
}
|
||||||
|
}
|
||||||
$associationMappingArray = array_merge($associationMappingArray, $oneToManyMappingArray);
|
$associationMappingArray = array_merge($associationMappingArray, $oneToManyMappingArray);
|
||||||
} else if ($associationMapping['type'] == ClassMetadataInfo::MANY_TO_MANY) {
|
} else if ($associationMapping['type'] == ClassMetadataInfo::MANY_TO_MANY) {
|
||||||
$method = 'mapManyToMany';
|
$method = 'mapManyToMany';
|
||||||
$manyToManyMappingArray = array(
|
$potentialAssociationMappingIndexes = array(
|
||||||
'mappedBy' => $associationMapping['mappedBy'],
|
'mappedBy',
|
||||||
'joinTable' => $associationMapping['joinTable'],
|
'joinTable',
|
||||||
'orderBy' => $associationMapping['orderBy']
|
'orderBy',
|
||||||
);
|
);
|
||||||
|
foreach ($potentialAssociationMappingIndexes as $index) {
|
||||||
|
if (isset($associationMapping[$index])) {
|
||||||
|
$manyToManyMappingArray[$index] = $associationMapping[$index];
|
||||||
|
}
|
||||||
|
}
|
||||||
$associationMappingArray = array_merge($associationMappingArray, $manyToManyMappingArray);
|
$associationMappingArray = array_merge($associationMappingArray, $manyToManyMappingArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user