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

  • Home
  • SEARCH
  • 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 4086156
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:41:10+00:00 2026-05-20T18:41:10+00:00

I’m building a web app and would like to use an ORM to map

  • 0

I’m building a web app and would like to use an ORM to map the data from db with objects.
I have been struggling with this for a few days, and tried various implementations, including: Codeigniter ORM, Kohana ORM, PHP.ActiveRecords and Doctrine.
The last two I can’t really use, because they depend on PHP 5.3 which is not installed (and can not be) on my shared hosting server.

The problem with all these ORM-s is inheritance (except for Doctrine, but I can’ use it).
I know a lot of developers just do db-s without inheritance, but here is my problem:

My db needs to be multilingual, I designed my db by the following example:
Table Product -> id, category_id, price... (everything that is not translatable)
Table ProductTranslation-> id, language_id, name, description... (same id as product, adds language FK, and fields that are translatable)

Maybe there is a better approach, but I really like this, because its very flexible (can add new languages) and does not put a lot of NULL-s in the db, also joining is not that costly because the tables are relatively small (unlike the approach to put all translations in a single table, and reference that table from all other tables).

The only workaround, I found, to support ORMs is to put a has_one relation between
Product->ProductTranslation.

This way I could access the translated fields with something like:
DB::get_product_by_id(4)->translation->name

Nevermind the syntax, but the real problem with this approach is that I have to define new objects(models) for translation tables, and logically they don’t belong there. They are not entities, just additional data for the entities.

So, my question here are:

  • Is there a better way to organize languages in the db, which is more ORM friendly ?
  • Are there any other PHP ORM-s (<5.3) which support inheritance ? – Btw. I found the Kohana ORM ihertiance module but it seems out-of-date, and doesn’t work with the current framework version
  • Are there any other workaround for the inheritance problem?
  • 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-20T18:41:12+00:00Added an answer on May 20, 2026 at 6:41 pm

    Doctrine 2.0 requires PHP 5.3, but Doctrine 1.2.x works fine on PHP 5.2.3 or newer.

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

Sidebar

Related Questions

I have some data like this: 1 2 3 4 5 9 2 6
We're building an app, our first using Rails 3, and we're having to build
I have a bunch of posts stored in text files formatted in yaml/textile (from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

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.