Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9197995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:11:25+00:00 2026-06-17T22:11:25+00:00

Basically, i have a branch of code that connects to three different entity managers

  • 0

Basically, i have a branch of code that connects to three different entity managers (and subsequently, three different MySQL databases).
Unfortunately, two of the databases have tables that are named he same thing, so i cant have all the entities in the same directory, and for structure, id like to avoid that anyways.

So, my question is… How would i set it up so i can have a single entity bundle, with sub-directories under Entity\ and Resources\config\doctrine\

e.g.

Acme\EntityBundle\Entity\DB1\Test.php
Acme\EntityBundle\Entity\DB1\Acme.php
Acme\EntityBundle\Entity\DB2\Test.php
Acme\EntityBundle\Entity\DB2\Foo.php
Acme\EntityBundle\Entity\DB3\Bar.php

and the same idea for Resources\config\doctrine\

The configs are very vague on what to do here…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T22:11:25+00:00Added an answer on June 17, 2026 at 10:11 pm

    If you just need the bundle to store entities, I’d rather suggest to store them outside. This way you’d decouple them from the framework.

    In both cases configuration is similar. Reference is accessible in the official docs.

    Here’s an example:

    #app/config/config.yml
    doctrine:
        orm:
            auto_generate_proxy_classes: %kernel.debug%
            auto_mapping: true
            mappings:
                AcmeDB1:
                    type:       xml
                    is_bundle:  false
                    dir:        %kernel.root_dir%/../src/Acme/Entity/DB1/config
                    prefix:     Acme\Entity\DB1
                    alias:      AcmeDB1
                AcmeDB2:
                    type:       xml
                    is_bundle:  false
                    dir:        %kernel.root_dir%/../src/Acme/Entity/DB2/config
                    prefix:     Acme\Entity\DB2
                    alias:      AcmeDB2
    

    Few notes:

    • dir refers to the mapping directory, if you use annotations this should be directory where your entities are placed
    • prefix is part of your entity’s namespace and it should be unique
    • alias makes that you can refer to your entities with shorter namespaces, like AcmeDB1:User
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I basically have a program that filters records from one excel file to another
I basically have three tables, posts, images and postimages (this simply contains the ids
I basically have 7 select statements that I need to have the results output
Basically I have written a game plugin that will allow server admins to update
I have a local branch that is tracking of a remote branch on git.
I have to design a branch-and bound algorithm that solves the optimal tour of
I have the next version of my code base that I've been working on
Previously, using SVN, I would have a branch that was my development branch, which
I don't understand svn merge. Here's the scenario: We have a branch that contains
I have a branch in TFS 2010 that has a Gates Check-in build associated.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.