File tree 1 file changed +10
-4
lines changed 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 11
11
12
12
namespace FOS \UserBundle ;
13
13
14
+ use Doctrine \Bundle \MongoDBBundle \DependencyInjection \Compiler \DoctrineMongoDBMappingsPass ;
14
15
use FOS \UserBundle \DependencyInjection \Compiler \ValidationPass ;
15
16
use Doctrine \Bundle \DoctrineBundle \DependencyInjection \Compiler \DoctrineOrmMappingsPass ;
16
17
use Symfony \Component \HttpKernel \Bundle \Bundle ;
@@ -27,13 +28,18 @@ public function build(ContainerBuilder $container)
27
28
parent ::build ($ container );
28
29
$ container ->addCompilerPass (new ValidationPass ());
29
30
31
+ $ mappings = array (
32
+ realpath (__DIR__ .'/Resources/config/doctrine/model ' ) => 'FOS\UserBundle\Model ' ,
33
+ );
34
+
30
35
if (class_exists ('Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass ' )) {
31
- $ mappings = array (
32
- realpath (__DIR__ .'/Resources/config/doctrine/model ' ) => 'FOS\UserBundle\Model ' ,
33
- );
34
36
$ container ->addCompilerPass (DoctrineOrmMappingsPass::createXmlMappingDriver ($ mappings , 'fos_user.backend_type_orm ' ));
35
37
}
36
38
37
- // TODO: couch, mongo
39
+ if (class_exists ('Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\DoctrineMongoDBMappingsPass ' )) {
40
+ $ container ->addCompilerPass (DoctrineMongoDBMappingsPass::createXmlMappingDriver ($ mappings , 'fos_user.backend_type_mongodb ' ));
41
+ }
42
+
43
+ // TODO: couch
38
44
}
39
45
}
You can’t perform that action at this time.
0 commit comments