浏览代码

fixes issue when using default doctrine configuration:
Doctrine\Common\Annotations\AnnotationException: [Semantical Error] The annotation "@Entity" in class (...) was never imported.

Mathias Verraes 14 年之前
父节点
当前提交
0594ee99c9
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      lib/Gedmo/Mapping/MappedEventSubscriber.php

+ 1 - 0
lib/Gedmo/Mapping/MappedEventSubscriber.php

@@ -200,6 +200,7 @@ abstract class MappedEventSubscriber implements EventSubscriber
                     'Gedmo\\Mapping\\Annotation',
                     __DIR__ . '/../../'
                 );
+                $reader->setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\');
                 $reader = new \Doctrine\Common\Annotations\CachedReader($reader, new ArrayCache());
             } else if (version_compare(\Doctrine\Common\Version::VERSION, '2.1.0-BETA3-DEV', '>=')) {
                 $reader = new \Doctrine\Common\Annotations\AnnotationReader();