[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();
|
$cascade = array();
|
||||||
if ($associationMapping->isCascadeRemove) {
|
if ($associationMapping->isCascadeRemove) {
|
||||||
$cascade[] = 'remove';
|
$cascade[] = 'cascade-remove';
|
||||||
}
|
}
|
||||||
if ($associationMapping->isCascadePersist) {
|
if ($associationMapping->isCascadePersist) {
|
||||||
$cascade[] = 'persist';
|
$cascade[] = 'cascade-persist';
|
||||||
}
|
}
|
||||||
if ($associationMapping->isCascadeRefresh) {
|
if ($associationMapping->isCascadeRefresh) {
|
||||||
$cascade[] = 'refresh';
|
$cascade[] = 'cascade-refresh';
|
||||||
}
|
}
|
||||||
if ($associationMapping->isCascadeMerge) {
|
if ($associationMapping->isCascadeMerge) {
|
||||||
$cascade[] = 'merge';
|
$cascade[] = 'cascade-merge';
|
||||||
}
|
}
|
||||||
if ($associationMapping->isCascadeDetach) {
|
if ($associationMapping->isCascadeDetach) {
|
||||||
$cascade[] = 'detach';
|
$cascade[] = 'cascade-detach';
|
||||||
}
|
}
|
||||||
if ($cascade) {
|
if ($cascade) {
|
||||||
$cascadeXml = $associationMappingXml->addChild('cascade');
|
$cascadeXml = $associationMappingXml->addChild('cascade');
|
||||||
|
@ -290,6 +290,20 @@ abstract class AbstractClassMetadataExporterTest extends \Doctrine\Tests\OrmTest
|
|||||||
return $class;
|
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()
|
public function __destruct()
|
||||||
{
|
{
|
||||||
$type = $this->_getType();
|
$type = $this->_getType();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user