浏览代码

merged branch Tobion/patch-3 (PR #2931)

Commits
-------

1eb5583 fixes #2906

Discussion
----------

Fix for #2906

closes #2906
Fabien Potencier 13 年之前
父节点
当前提交
89bd0d7874
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Symfony/Bundle/DoctrineBundle/Mapping/MetadataFactory.php

+ 1 - 1
src/Symfony/Bundle/DoctrineBundle/Mapping/MetadataFactory.php

@@ -77,12 +77,12 @@ class MetadataFactory
         if (class_exists($class)) {
             $r = $all[0]->getReflectionClass();
             $path = $this->getBasePathForClass($class, $r->getNamespacename(), dirname($r->getFilename()));
+            $metadata->setNamespace($r->getNamespacename());
         } elseif (!$path) {
             throw new \RuntimeException(sprintf('Unable to determine where to save the "%s" class (use the --path option).', $class));
         }
 
         $metadata->setPath($path);
-        $metadata->setNamespace($r->getNamespacename());
 
         return $metadata;
     }