1
0
mirror of synced 2025-01-20 07:21:40 +03:00

[DDC-641] Fixing issue with XmlExporter cascade options

This commit is contained in:
Jonathan H. Wage 2010-06-16 11:10:03 -04:00
parent 438de30aa3
commit e6f465ec80
2 changed files with 19 additions and 5 deletions

View File

@ -266,19 +266,19 @@ class XmlExporter extends AbstractExporter
}
$cascade = array();
if ($associationMapping->isCascadeRemove) {
$cascade[] = 'remove';
$cascade[] = 'cascade-remove';
}
if ($associationMapping->isCascadePersist) {
$cascade[] = 'persist';
$cascade[] = 'cascade-persist';
}
if ($associationMapping->isCascadeRefresh) {
$cascade[] = 'refresh';
$cascade[] = 'cascade-refresh';
}
if ($associationMapping->isCascadeMerge) {
$cascade[] = 'merge';
$cascade[] = 'cascade-merge';
}
if ($associationMapping->isCascadeDetach) {
$cascade[] = 'detach';
$cascade[] = 'cascade-detach';
}
if ($cascade) {
$cascadeXml = $associationMappingXml->addChild('cascade');

View File

@ -290,6 +290,20 @@ abstract class AbstractClassMetadataExporterTest extends \Doctrine\Tests\OrmTest
return $class;
}
/**
* @depends testLifecycleCallbacksAreExported
* @param ClassMetadataInfo $class
*/
public function testCascadeIsExported($class)
{
$this->assertTrue($class->associationMappings['phonenumbers']->isCascadePersist);
$this->assertFalse($class->associationMappings['phonenumbers']->isCascadeMerge);
$this->assertFalse($class->associationMappings['phonenumbers']->isCascadeRemove);
$this->assertFalse($class->associationMappings['phonenumbers']->isCascadeRefresh);
return $class;
}
public function __destruct()
{
$type = $this->_getType();