1
0
mirror of synced 2025-01-29 19:41:45 +03:00

Revert "Implemented auto-inference of isCascadeRemove when orphanRemoval is defined (marked as todo)."

This reverts commit 551247d11a0346dfb878a1e3571655a9395958ab.
This commit is contained in:
Benjamin Eberlei 2011-05-15 20:39:55 +02:00
parent 2cfdf2b05d
commit 5e938b3147

View File

@ -909,13 +909,9 @@ class ClassMetadataInfo implements ClassMetadata
$mapping['targetToSourceKeyColumns'] = array_flip($mapping['sourceToTargetKeyColumns']); $mapping['targetToSourceKeyColumns'] = array_flip($mapping['sourceToTargetKeyColumns']);
} }
//TODO: if orphanRemoval, cascade=remove is implicit!
$mapping['orphanRemoval'] = isset($mapping['orphanRemoval']) ? $mapping['orphanRemoval'] = isset($mapping['orphanRemoval']) ?
(bool) $mapping['orphanRemoval'] : false; (bool) $mapping['orphanRemoval'] : false;
// if orphanRemoval, cascade=remove is implicit
if ($mapping['orphanRemoval']) {
$mapping['isCascadeRemove'] = true;
}
if (isset($mapping['id']) && $mapping['id'] === true && !$mapping['isOwningSide']) { if (isset($mapping['id']) && $mapping['id'] === true && !$mapping['isOwningSide']) {
throw MappingException::illegalInverseIdentifierAssocation($this->name, $mapping['fieldName']); throw MappingException::illegalInverseIdentifierAssocation($this->name, $mapping['fieldName']);
@ -940,14 +936,10 @@ class ClassMetadataInfo implements ClassMetadata
throw MappingException::oneToManyRequiresMappedBy($mapping['fieldName']); throw MappingException::oneToManyRequiresMappedBy($mapping['fieldName']);
} }
//TODO: if orphanRemoval, cascade=remove is implicit!
$mapping['orphanRemoval'] = isset($mapping['orphanRemoval']) ? $mapping['orphanRemoval'] = isset($mapping['orphanRemoval']) ?
(bool) $mapping['orphanRemoval'] : false; (bool) $mapping['orphanRemoval'] : false;
// if orphanRemoval, cascade=remove is implicit
if ($mapping['orphanRemoval']) {
$mapping['isCascadeRemove'] = true;
}
if (isset($mapping['orderBy'])) { if (isset($mapping['orderBy'])) {
if ( ! is_array($mapping['orderBy'])) { if ( ! is_array($mapping['orderBy'])) {
throw new \InvalidArgumentException("'orderBy' is expected to be an array, not ".gettype($mapping['orderBy'])); throw new \InvalidArgumentException("'orderBy' is expected to be an array, not ".gettype($mapping['orderBy']));