1
0
mirror of synced 2025-01-18 06:21:40 +03:00

DDC-897 - Fix DisconnecetdClassMetadataFactory with regards to namespace setting, now inferred from the FQCN.

This commit is contained in:
Benjamin Eberlei 2010-11-27 22:17:55 +01:00
parent dff5dae416
commit 796b62cd2c

View File

@ -1,7 +1,5 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@ -33,7 +31,6 @@ use Doctrine\ORM\Mapping\ClassMetadataInfo;
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision$
* @author Benjamin Eberlei <kontakt@beberlei.de>
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
@ -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;
}
/**