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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:29:27+00:00 2026-06-08T19:29:27+00:00

I am looking for a little advice on database design. I am constructing a

  • 0

I am looking for a little advice on database design.

I am constructing a slideshow applicatino on the symfony2 platform, and I have four different types of slideshow containers (company, geo-area, property and individual monitors). This is for the purpose of organizing content and inheriting content down the line (a monitor sits in a property, a property is part of a geoarea etc.).

Now, on flat PHP I would have used only two tables, “containers” and “contents”, and put a type field in the containers table defining whether the container in question is a geo-area, property etc. and just linking each content piece (i.e. slide) with a FK to the appropriate container.

Now, learning about symfony2’s entity system, it seems that I could gain a lot inheritance-wise by instead defining the different container types as separate entities, thus being able to fetch for instance the geo-area, and automatically get returned all of its child objects (all properties, and in turn all monitors belonging to that property) on the fly. I do however want to be able to switch the “belonging” of a content piece between different containers, and different container types. I sense this will be somewhat hairy with the described approach, seeing there will most likely be a problem with the relation (FK) of the content piece if it must have the capability of “belonging to” any of four different entiy types?

Someone seasoned in the symfony2 world could perhaps enlighten me as to the wisest path to proceed 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-08T19:29:29+00:00Added an answer on June 8, 2026 at 7:29 pm

    In our project we use Propel 1.6 and PropelBundle

    Its syntax is quite developer-friendly.
    One great advantage of Propel is “fake” relations between tables. In your schema by just defining skipSql = true flag you omit the generation of FK, but one object can be fetched with another just by defined fake relation.

    In your case it will end up with something like below:

    $containers = ContainerQuery::create()->findByXXX('xxx');
    $containers->getFirst()->getContents(); // Will return all joined content for the first container
    

    During population of objects with related ones – you achieve great opportunity to use reverse relations:

    $contents = $container->getContents();
    $container = $contents->getContainer();
    

    Just ask in comments, and I’ll extend my answer with whatever you need 😉

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

Sidebar

Related Questions

I'm looking for a little database design advice... I have a spreadsheet with a
I have heard conflicting stories on this topic and am looking for a little
I have a little / weird behaviour here and Im looking over internet and
So I am a little confused, I have been looking around trying to determine
I'm looking for a little sage advice from some helpful HTML/CSS masters. I am
All, I'm looking for advice over the following scenario: I have a component running
Looking for advice (perhaps best practice). We have a MS Word document (Office 2007)
I'm looking for some advice. I have been given a paper form with various
Looking for a little advice on leveraging AsParallel() or Parallel.ForEach() to speed this up.
I am looking for a little advice on structuring the following. I would like

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.