1
0
mirror of synced 2025-01-22 00:01:40 +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'])) {
$metadata->setVersionMapping($mapping);
unset($mapping['version']);
}
$metadata->mapField($mapping);
@ -686,7 +687,7 @@ class XmlDriver extends FileDriver
}
if (isset($fieldMapping['version']) && $fieldMapping['version']) {
$mapping['version'] = $fieldMapping['version'];
$mapping['version'] = $this->evaluateBoolean($fieldMapping['version']);
}
if (isset($fieldMapping['column-definition'])) {

View File

@ -300,6 +300,7 @@ class YamlDriver extends FileDriver
if (isset($mapping['version'])) {
$metadata->setVersionMapping($mapping);
unset($mapping['version']);
}
$metadata->mapField($mapping);

View File

@ -159,6 +159,8 @@ abstract class AbstractMappingDriverTest extends \Doctrine\Tests\OrmTestCase
{
$this->assertTrue($class->isVersioned);
$this->assertEquals("version", $class->versionField);
$this->assertFalse(isset($class->fieldMappings['version']['version']));
}
/**