/** * @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-mapping') => 'JavierEguiluz\\Bundle\\EasyAdminBundle\\Model'); if ($symfonyVersion && class_exists('Doctrine\\Bundle\\DoctrineBundle\\DependencyInjection\\Compiler\\DoctrineOrmMappingsPass')) { $container->addCompilerPass(DoctrineOrmMappingsPass::createXmlMappingDriver($mappings, array('easy_admin.model_manager_name'), 'easy_admin.backend_type_orm')); } else { $container->addCompilerPass(RegisterMappingsPass::createOrmMappingDriver($mappings)); } }
/** * You should not directly instantiate this class but use one of the * factory methods. * * @param Definition|Reference $driver the driver to use * @param array $namespaces list of namespaces this driver should handle. * @param string[] $managerParameters ordered list of container parameters that may * provide the name of the manager to register the mappings for. The first non-empty name * is used, the others skipped. * @param bool $enabledParameter if specified, the compiler pass only executes * if this parameter exists in the service container. */ public function __construct($driver, $namespaces, array $managerParameters, $enabledParameter = false) { $managerParameters[] = 'doctrine.default_entity_manager'; parent::__construct($driver, $namespaces, $managerParameters, 'doctrine.orm.%s_metadata_driver', $enabledParameter); }
/** * You should not directly instantiate this class but use one of the * factory methods. * * @param Definition|Reference $driver Driver DI definition or reference. * @param array $namespaces List of namespaces handled by $driver. * @param string[] $managerParameters Ordered list of container parameters that * could hold the manager name. * doctrine.default_entity_manager is appended * automatically. * @param string|false $enabledParameter If specified, the compiler pass only executes * if this parameter is defined in the service * container. * @param array $aliasMap Map of alias to namespace. */ public function __construct($driver, array $namespaces, array $managerParameters, $enabledParameter = false, array $aliasMap = array()) { $managerParameters[] = 'doctrine.default_entity_manager'; parent::__construct($driver, $namespaces, $managerParameters, 'doctrine.orm.%s_metadata_driver', $enabledParameter, 'doctrine.orm.%s_configuration', 'addEntityNamespace', $aliasMap); }
/** * You should not directly instantiate this class but use one of the * factory methods. * * @param Definition|Reference $driver the driver to use * @param array $namespaces list of namespaces this driver should handle * @param string[] $managerParameters list of parameters that could tell the manager name to use * @param bool $enabledParameter if specified, the compiler pass only * executes if this parameter exists in the service container. * @param string[] $aliasMap Map of alias to namespace. */ public function __construct($driver, array $namespaces, array $managerParameters, $enabledParameter = false, array $aliasMap = []) { $managerParameters[] = 'doctrine_mongodb.odm.default_document_manager'; parent::__construct($driver, $namespaces, $managerParameters, 'doctrine_mongodb.odm.%s_metadata_driver', $enabledParameter, 'doctrine_mongodb.odm.%s_configuration', 'addDocumentNamespace', $aliasMap); }
/** * You should not directly instantiate this class but use one of the * factory methods. * * @param Definition|Reference $driver * @param array|\string[] $namespaces * @param array $managerParameters * @param bool $enabledParameter */ public function __construct($driver, $namespaces, array $managerParameters, $enabledParameter = false) { $managerParameters[] = 'doctrine_orm_phpcr_adapter.adapter.default_adapter_manager'; parent::__construct($driver, $namespaces, $managerParameters, 'doctrine_orm_phpcr_adapter.adapter.%s_metadata_driver', $enabledParameter); }