diff --git a/lib/Doctrine/ORM/Tools/DisconnectedClassMetadataFactory.php b/lib/Doctrine/ORM/Tools/DisconnectedClassMetadataFactory.php index 436c04b4f..55503d400 100644 --- a/lib/Doctrine/ORM/Tools/DisconnectedClassMetadataFactory.php +++ b/lib/Doctrine/ORM/Tools/DisconnectedClassMetadataFactory.php @@ -1,7 +1,5 @@ * @author Guilherme Blanco * @author Jonathan Wage @@ -46,7 +43,13 @@ class DisconnectedClassMetadataFactory extends ClassMetadataFactory */ protected function newClassMetadataInstance($className) { - return new ClassMetadataInfo($className); + $metadata = new ClassMetadataInfo($className); + if (strpos($className, "\\") !== false) { + $metadata->namespace = strrev(substr( strrev($className), strpos(strrev($className), "\\")+1 )); + } else { + $metadata->namespace = ""; + } + return $metadata; } /**