[DoctrineBundle] fixed the overridding of an Entity

This commit is contained in:
Fabien Potencier 2010-03-10 22:29:45 +01:00
parent dad75524fc
commit fff133414d

View File

@ -201,7 +201,7 @@ class DoctrineExtension extends LoaderExtension
$bundleEntityMappings = array();
$bundleDirs = $this->bundleDirs;
$aliasMap = array();
foreach ($this->bundles as $className)
foreach (array_reverse($this->bundles) as $className)
{
$tmp = dirname(str_replace('\\', '/', $className));
$namespace = str_replace('/', '\\', dirname($tmp));
@ -209,6 +209,9 @@ class DoctrineExtension extends LoaderExtension
if (isset($bundleDirs[$namespace]))
{
continue;
}
$type = false;
if (is_dir($dir = $bundleDirs[$namespace].'/'.$class.'/Resources/config/doctrine/metadata'))
{
@ -231,7 +234,6 @@ class DoctrineExtension extends LoaderExtension
);
}
}
}
$ormConfigDef->addMethodCall('setEntityNamespaces', array($aliasMap));
$configuration->setDefinition('doctrine.orm.metadata_driver', $mappingDriverDef);