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 6850991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:11:34+00:00 2026-05-27T01:11:34+00:00

In my DB I have two relation between two tables : A many to

  • 0

In my DB I have two relation between two tables :

A “many to one” and a “many to many”

Database Schema

So when I load the object CEO i have that :

[ceo] => Object
    (
        [id] => 1
        [Current_Company] => Object
             (
                 [id] => 1
                 [ceo] => Object
                  *RECURSION*
             )
    )

There is no error, doctrine and symfony work well. But is it a good way to keep that recursion in the schema ?

  • 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-05-27T01:11:35+00:00Added an answer on May 27, 2026 at 1:11 am

    I think this question is more general than Doctrine and Symfony, so I’ll give a high level answer, sharing my philosophy.

    There are two camps of thinking:

    1. A database is more important than an application using it,
    2. An application is more important than a database.

    I belong to the first camp. For me, a database usually outlives the applications using it, so it’s logical to bend applications to a database — not vice versa. That means that, if the database and the application layer have a conflict, the database layer wins. That’s why I favor the DataMapper pattern over ActiveRecord: AR makes you change you database schema to match your application, while DM makes your application fit the database schema.

    It’s perfectly fine to have bidirectional relationships in the database schema, so whatever database abstraction tool I’m using, it has to accept that and live with that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question about One-To-Many relationship between two tables when there is the
Lets say I have two tables - child and parent with many-to-one relation. What
I have a legacy data base and a relation one-to-one between two tables. The
We have two tables Family and Member, the relation between these two is Family
Let's say, I have two tables, entities and tags. Relation between them is expressed
I have two tables, Products and BundleProducts that have o2o relation with BaseProducts. A
I have a many-to-many relation in 3 tables: ProgramUserGroup and Feature are the two
I have a relation between two tables with 600K rows and my first question
I have two tables. Those tables have two relation between them. Table 1 *
I am trying to create a relation/table in Oracle that is between two many

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.