1

I am currently rebuilding a back-end CMS/CRM/user management system for our front-facing website. Historically, the databases for the two systems have been combined into one, huge, sloppy database (for example CRM data and user data are two separate tables). All of the tables on the website itself, and the back-end system, interface with each other (ie. I can create new users with the back-end system OR register on the website itself).

Now, as I mentioned, I'm rebuilding the system using Symfony2. I'm migrating it to a separate webserver (security, etc.) and therefore migrating it's portion of the DB to its own database. However, I'd still like for it to interact with the website's database.

Is there a relatively simple method in Symfony to make this kind of connection, or does everything need to be hosted in the same database?

1 Answer 1

4

CookBook Says you can set up several connections as managers.

Than you can call it as following from the controller

    // both return the "default" em
    $em = $this->get('doctrine')->getManager();
    $em = $this->get('doctrine')->getManager('default');

    $customerEm =  $this->get('doctrine')->getManager('customer');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.