1
0
Fork 0
mirror of synced 2025-04-03 13:23:37 +03:00

[DDC-2300] Fix version xml mapping and serialization of ClassMetadata.

This commit is contained in:
Benjamin Eberlei 2013-03-14 23:19:58 +01:00
parent 4982e2b6b0
commit d0419782bd
3 changed files with 5 additions and 1 deletions

View file

@ -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'])) {

View file

@ -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);

View file

@ -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']));
} }
/** /**