Article:
  Simplify Business Logic with PHP DataObjects
Subject:   DataObject per table
Date:   2005-07-01 14:18:49
From:   y11o
Response to: DataObject per table

you might be interested in seeing the EZPDO project (http://www.ezpdo.net) and especially this post (http://www.ezpdo.net/forum/viewtopic.php?id=20) which talks about exactly the problem you try to solve.



[Excerpt from the post]


The class hierarchy looks like this.



Graphic -+- Point
|
+- Line
|
+- Text


This is a simple example of the Composite design pattern. Each Graphic object can have
a parent Graphic object and a set of child Graphic objects. EZPDO can persist all the
composition relationships and you will find it is fairly easy to do with EZPDO.