Results 1 to 2 of 2  Thread: Polymorphic DB Tables    1. #1
Join Date     Dec 2006      Polymorphic DB Tables      (Summary:
I want to have an is-a relationship in PHP also be in the
database, and if I search for something in the table of the base
class, it will also search in the table of the child class. I
also need this treatment with updating, inserting, and deleting.
Does anyone know of a framework that will do this?)      So,
I've been dealing with some pretty crazy ideas. But I'm
absolutely positive that others have thought of this and perhaps
even implemented it, though google and forum searches reveal
nothing.      In PHP, I have a base class:     - Person, with
property "name".     Two subclasses of Person:     - Programmer,
with property "IQ" and inherited property "name".     -
Quarterback, with property "Apishness" and inherited property
"name".      The question is how to represent this class "Tree"
in the database.      === Implementation 1 ===      In the
database, there is one table: