Author: fabien
Date: 2010-03-10 22:45:04 +0100 (Wed, 10 Mar 2010)
New Revision: 28466

Modified:
   
branches/2.0/src/Symfony/Framework/DoctrineBundle/DependencyInjection/DoctrineExtension.php
Log:
Merge branch 'master' of git://github.com/symfony/symfony

Modified: 
branches/2.0/src/Symfony/Framework/DoctrineBundle/DependencyInjection/DoctrineExtension.php
===================================================================
--- 
branches/2.0/src/Symfony/Framework/DoctrineBundle/DependencyInjection/DoctrineExtension.php
 2010-03-10 21:42:20 UTC (rev 28465)
+++ 
branches/2.0/src/Symfony/Framework/DoctrineBundle/DependencyInjection/DoctrineExtension.php
 2010-03-10 21:45:04 UTC (rev 28466)
@@ -201,36 +201,38 @@
       $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));
         $class = basename($tmp);
 
-        if (isset($bundleDirs[$namespace]))
+        if (!isset($bundleDirs[$namespace]))
         {
-          $type = false;
-          if (is_dir($dir = 
$bundleDirs[$namespace].'/'.$class.'/Resources/config/doctrine/metadata'))
-          {
-            $type = $this->detectMappingType($dir);
-          }
+          continue;
+        }
 
-          if (is_dir($dir = $bundleDirs[$namespace].'/'.$class.'/Entities'))
-          {
-            $type = 'annotation';
+        $type = false;
+        if (is_dir($dir = 
$bundleDirs[$namespace].'/'.$class.'/Resources/config/doctrine/metadata'))
+        {
+          $type = $this->detectMappingType($dir);
+        }
 
-            $aliasMap[$class] = $namespace.'\\'.$class.'\\Entities';
-          }
+        if (is_dir($dir = $bundleDirs[$namespace].'/'.$class.'/Entities'))
+        {
+          $type = 'annotation';
 
-          if (false !== $type)
-          {
-            $mappingDriverDef->addMethodCall('addDriver', array(
-                new Reference(sprintf('doctrine.orm.metadata_driver.%s', 
$type)),
-                $namespace.'\\'.$class.'\\Entities'
-              )
-            );
-          }
+          $aliasMap[$class] = $namespace.'\\'.$class.'\\Entities';
         }
+
+        if (false !== $type)
+        {
+          $mappingDriverDef->addMethodCall('addDriver', array(
+              new Reference(sprintf('doctrine.orm.metadata_driver.%s', $type)),
+              $namespace.'\\'.$class.'\\Entities'
+            )
+          );
+        }
       }
       $ormConfigDef->addMethodCall('setEntityNamespaces', array($aliasMap));
 

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to