diff --git a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php index 461038932..ed4386ac4 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php @@ -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'])) { diff --git a/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php index bf97f19fb..5bd58ef79 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php @@ -300,6 +300,7 @@ class YamlDriver extends FileDriver if (isset($mapping['version'])) { $metadata->setVersionMapping($mapping); + unset($mapping['version']); } $metadata->mapField($mapping); diff --git a/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php index 5d713c25c..28e6f1ede 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php @@ -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'])); } /**