[DDC-2300] Fix version xml mapping and serialization of ClassMetadata.
This commit is contained in:
parent
4982e2b6b0
commit
d0419782bd
3 changed files with 5 additions and 1 deletions
|
@ -234,6 +234,7 @@ class XmlDriver extends FileDriver
|
||||||
|
|
||||||
if (isset($mapping['version'])) {
|
if (isset($mapping['version'])) {
|
||||||
$metadata->setVersionMapping($mapping);
|
$metadata->setVersionMapping($mapping);
|
||||||
|
unset($mapping['version']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$metadata->mapField($mapping);
|
$metadata->mapField($mapping);
|
||||||
|
@ -686,7 +687,7 @@ class XmlDriver extends FileDriver
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($fieldMapping['version']) && $fieldMapping['version']) {
|
if (isset($fieldMapping['version']) && $fieldMapping['version']) {
|
||||||
$mapping['version'] = $fieldMapping['version'];
|
$mapping['version'] = $this->evaluateBoolean($fieldMapping['version']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($fieldMapping['column-definition'])) {
|
if (isset($fieldMapping['column-definition'])) {
|
||||||
|
|
|
@ -300,6 +300,7 @@ class YamlDriver extends FileDriver
|
||||||
|
|
||||||
if (isset($mapping['version'])) {
|
if (isset($mapping['version'])) {
|
||||||
$metadata->setVersionMapping($mapping);
|
$metadata->setVersionMapping($mapping);
|
||||||
|
unset($mapping['version']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$metadata->mapField($mapping);
|
$metadata->mapField($mapping);
|
||||||
|
|
|
@ -159,6 +159,8 @@ abstract class AbstractMappingDriverTest extends \Doctrine\Tests\OrmTestCase
|
||||||
{
|
{
|
||||||
$this->assertTrue($class->isVersioned);
|
$this->assertTrue($class->isVersioned);
|
||||||
$this->assertEquals("version", $class->versionField);
|
$this->assertEquals("version", $class->versionField);
|
||||||
|
|
||||||
|
$this->assertFalse(isset($class->fieldMappings['version']['version']));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue