diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php index f556257f9..b52029421 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php @@ -909,9 +909,13 @@ class ClassMetadataInfo implements ClassMetadata $mapping['targetToSourceKeyColumns'] = array_flip($mapping['sourceToTargetKeyColumns']); } - //TODO: if orphanRemoval, cascade=remove is implicit! $mapping['orphanRemoval'] = isset($mapping['orphanRemoval']) ? (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']) { throw MappingException::illegalInverseIdentifierAssocation($this->name, $mapping['fieldName']); @@ -936,10 +940,14 @@ class ClassMetadataInfo implements ClassMetadata throw MappingException::oneToManyRequiresMappedBy($mapping['fieldName']); } - //TODO: if orphanRemoval, cascade=remove is implicit! $mapping['orphanRemoval'] = isset($mapping['orphanRemoval']) ? (bool) $mapping['orphanRemoval'] : false; + // if orphanRemoval, cascade=remove is implicit + if ($mapping['orphanRemoval']) { + $mapping['isCascadeRemove'] = true; + } + if (isset($mapping['orderBy'])) { if ( ! is_array($mapping['orderBy'])) { throw new \InvalidArgumentException("'orderBy' is expected to be an array, not ".gettype($mapping['orderBy']));