[DDC-641] Fixing issue with XmlExporter cascade options
This commit is contained in:
parent
438de30aa3
commit
e6f465ec80
@ -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');
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user