Преглед изворни кода

[DoctrineBundle] fixed Doctrine extension to always create aliases for entities in the Entities/ directory

Fabien Potencier пре 15 година
родитељ
комит
9d060340f6

+ 3 - 5
src/Symfony/Framework/DoctrineBundle/DependencyInjection/DoctrineExtension.php

@@ -208,11 +208,13 @@ class DoctrineExtension extends LoaderExtension
 
 
         if (isset($bundleDirs[$namespace]))
         if (isset($bundleDirs[$namespace]))
         {
         {
+          $type = false;
           if (is_dir($dir = $bundleDirs[$namespace].'/'.$class.'/Resources/config/doctrine/metadata'))
           if (is_dir($dir = $bundleDirs[$namespace].'/'.$class.'/Resources/config/doctrine/metadata'))
           {
           {
             $type = $this->detectMappingType($dir);
             $type = $this->detectMappingType($dir);
           }
           }
-          elseif (is_dir($dir = $bundleDirs[$namespace].'/'.$class.'/Entities'))
+
+          if (is_dir($dir = $bundleDirs[$namespace].'/'.$class.'/Entities'))
           {
           {
             $type = 'annotation';
             $type = 'annotation';
 
 
@@ -227,10 +229,6 @@ class DoctrineExtension extends LoaderExtension
               $ormConfigDef->addMethodCall('addEntityAlias', array($className, $alias));
               $ormConfigDef->addMethodCall('addEntityAlias', array($className, $alias));
             }
             }
           }
           }
-          else
-          {
-            $type = false;
-          }
 
 
           if (false !== $type)
           if (false !== $type)
           {
           {