コード例 #1
0
ファイル: HMLBDDDBundle.php プロジェクト: hmlb/ddd-bundle
 /**
  * @param ContainerBuilder $container
  */
 private function addRegisterMappingsPass(ContainerBuilder $container)
 {
     $mappings = [realpath(__DIR__ . '/Resources/config/doctrine') => 'HMLB\\DDD'];
     if (class_exists('Doctrine\\Bundle\\DoctrineBundle\\DependencyInjection\\Compiler\\DoctrineOrmMappingsPass')) {
         $container->addCompilerPass(DoctrineOrmMappingsPass::createXmlMappingDriver($mappings, ['fos_user.model_manager_name'], 'fos_user.backend_type_orm'));
     }
     if (class_exists('Doctrine\\Bundle\\MongoDBBundle\\DependencyInjection\\Compiler\\DoctrineMongoDBMappingsPass')) {
         $container->addCompilerPass(DoctrineMongoDBMappingsPass::createXmlMappingDriver($mappings, ['fos_user.model_manager_name'], 'fos_user.backend_type_mongodb'));
     }
     if (class_exists('Doctrine\\Bundle\\CouchDBBundle\\DependencyInjection\\Compiler\\DoctrineCouchDBMappingsPass')) {
         $container->addCompilerPass(DoctrineCouchDBMappingsPass::createXmlMappingDriver($mappings, ['fos_user.model_manager_name'], 'fos_user.backend_type_couchdb'));
     }
 }
コード例 #2
0
 private function addRegisterMappingsPass(ContainerBuilder $container)
 {
     $mappings = array(realpath(__DIR__ . '/Resources/config/model') => 'Bazinga\\OAuthServerBundle\\Model');
     if (class_exists('Doctrine\\Bundle\\DoctrineBundle\\DependencyInjection\\Compiler\\DoctrineOrmMappingsPass')) {
         $container->addCompilerPass(DoctrineOrmMappingsPass::createXmlMappingDriver($mappings, array('bazinga.oauth.model_manager_name'), 'bazinga.oauth.backend_type_orm'));
     }
     if (class_exists('Doctrine\\Bundle\\MongoDBBundle\\DependencyInjection\\Compiler\\DoctrineMongoDBMappingsPass')) {
         $container->addCompilerPass(DoctrineMongoDBMappingsPass::createXmlMappingDriver($mappings, array('bazinga.oauth.model_manager_name'), 'bazinga.oauth.backend_type_mongodb'));
     }
     if (class_exists('Doctrine\\Bundle\\CouchDBBundle\\DependencyInjection\\Compiler\\DoctrineCouchDBMappingsPass')) {
         $container->addCompilerPass(DoctrineCouchDBMappingsPass::createXmlMappingDriver($mappings, array('bazinga.oauth.model_manager_name'), 'bazinga.oauth.backend_type_couchdb'));
     }
 }
コード例 #3
0
 /**
  * @param ContainerBuilder $container
  */
 private function addRegisterMappingsPass(ContainerBuilder $container)
 {
     // the base class is only available since symfony 2.3
     $symfonyVersion = class_exists('Symfony\\Bridge\\Doctrine\\DependencyInjection\\CompilerPass\\RegisterMappingsPass');
     $mappings = array(realpath(__DIR__ . '/Resources/config/doctrine/model') => 'TwoMartens\\Bundle\\CoreBundle\\Model');
     if ($symfonyVersion && class_exists('Doctrine\\Bundle\\DoctrineBundle\\DependencyInjection\\Compiler\\DoctrineOrmMappingsPass')) {
         $container->addCompilerPass(DoctrineOrmMappingsPass::createXmlMappingDriver($mappings, array(), 'twomartens.core.backend_type_orm', array('TwoMartensCoreBundle' => 'TwoMartens\\Bundle\\CoreBundle\\Model')));
     }
     if ($symfonyVersion && class_exists('Doctrine\\Bundle\\MongoDBBundle\\DependencyInjection\\Compiler\\DoctrineMongoDBMappingsPass')) {
         $container->addCompilerPass(DoctrineMongoDBMappingsPass::createXmlMappingDriver($mappings, array(), 'twomartens.core.backend_type_mongodb', array('TwoMartensCoreBundle' => 'TwoMartens\\Bundle\\CoreBundle\\Model')));
     }
     if ($symfonyVersion && class_exists('Doctrine\\Bundle\\CouchDBBundle\\DependencyInjection\\Compiler\\DoctrineCouchDBMappingsPass')) {
         $container->addCompilerPass(DoctrineCouchDBMappingsPass::createXmlMappingDriver($mappings, array(), 'twomartens.core.backend_type_couchdb', array('TwoMartensCoreBundle' => 'TwoMartens\\Bundle\\CoreBundle\\Model')));
     }
 }
コード例 #4
0
 /**
  * @param ContainerBuilder $container
  */
 private function addRegisterMappingsPass(ContainerBuilder $container)
 {
     // the base class is only available since symfony 2.3
     $symfonyVersion = class_exists('Symfony\\Bridge\\Doctrine\\DependencyInjection\\CompilerPass\\RegisterMappingsPass');
     $mappings = array(realpath(__DIR__ . '/Resources/config/doctrine/model') => 'FOS\\UserBundle\\Model');
     if ($symfonyVersion && class_exists('Doctrine\\Bundle\\DoctrineBundle\\DependencyInjection\\Compiler\\DoctrineOrmMappingsPass')) {
         $container->addCompilerPass(DoctrineOrmMappingsPass::createXmlMappingDriver($mappings, array('fos_user.model_manager_name'), 'fos_user.backend_type_orm'));
     } else {
         $container->addCompilerPass(RegisterMappingsPass::createOrmMappingDriver($mappings));
     }
     if ($symfonyVersion && class_exists('Doctrine\\Bundle\\MongoDBBundle\\DependencyInjection\\Compiler\\DoctrineMongoDBMappingsPass')) {
         $container->addCompilerPass(DoctrineMongoDBMappingsPass::createXmlMappingDriver($mappings, array('fos_user.model_manager_name'), 'fos_user.backend_type_mongodb'));
     } else {
         $container->addCompilerPass(RegisterMappingsPass::createMongoDBMappingDriver($mappings));
     }
     if ($symfonyVersion && class_exists('Doctrine\\Bundle\\CouchDBBundle\\DependencyInjection\\Compiler\\DoctrineCouchDBMappingsPass')) {
         $container->addCompilerPass(DoctrineCouchDBMappingsPass::createXmlMappingDriver($mappings, array('fos_user.model_manager_name'), 'fos_user.backend_type_couchdb'));
     } else {
         $container->addCompilerPass(RegisterMappingsPass::createCouchDBMappingDriver($mappings));
     }
 }