Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle only works with default entity manager not with multiple EntityManagers #44

Open
sverraest opened this issue Mar 30, 2018 · 1 comment

Comments

@sverraest
Copy link

We are using dynamic database connections for multiple tenant databases but it seems the bundle is coupled to use the default entity manager only.

When running the migration script for the db, even when specifying the em, it fails due to

...has a dependency on a non-existent service "doctrine.orm.default_entity_manager".

I can't immediately see a config setting to override this

@imbachb
Copy link

imbachb commented Jan 3, 2023

Might not help in OP's case but in my case, I could overwrite the configuration of craue_config_default and specify my non-default entity manager there:

services.yaml

services:
  craue_config_default:
    class: Craue\ConfigBundle\Util\Config
    public: true
    arguments:
      - '@craue_config_cache_adapter'
    calls:
      - setEntityManager: ['@doctrine.orm.universe_entity_manager']
      - setEntityName: ['%craue_config.entity_name%']

where universe was the name of the non-default entity manager.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants