Permalink
Browse files

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

  • Loading branch information...
1 parent 4982e2b commit d0419782bd2eacada1ea0ba0adf3748932b9486b @beberlei beberlei committed Mar 14, 2013
@@ -234,6 +234,7 @@ public function loadMetadataForClass($className, ClassMetadata $metadata)
if (isset($mapping['version'])) {
$metadata->setVersionMapping($mapping);
+ unset($mapping['version']);
}
$metadata->mapField($mapping);
@@ -686,7 +687,7 @@ private function columnToArray(SimpleXMLElement $fieldMapping)
}
if (isset($fieldMapping['version']) && $fieldMapping['version']) {
- $mapping['version'] = $fieldMapping['version'];
+ $mapping['version'] = $this->evaluateBoolean($fieldMapping['version']);
}
if (isset($fieldMapping['column-definition'])) {
@@ -300,6 +300,7 @@ public function loadMetadataForClass($className, ClassMetadata $metadata)
if (isset($mapping['version'])) {
$metadata->setVersionMapping($mapping);
+ unset($mapping['version']);
}
$metadata->mapField($mapping);
@@ -159,6 +159,8 @@ public function testVersionedField($class)
{
$this->assertTrue($class->isVersioned);
$this->assertEquals("version", $class->versionField);
+
+ $this->assertFalse(isset($class->fieldMappings['version']['version']));
}
/**

0 comments on commit d041978

Please sign in to comment.