I'm trying to write a class for abstracting some aspects of database programming and am running into a problem:
http://hashphp.org/pastebin.php?pid=567
The code works fine for the first instantiation of the DbTable (Product) class,
but not the second. It seems clear that the reason it works the first
time is that overload() isn't called until after describe() in DbTable's constructor,
so DbTable can "see" its actual properties. The second time it's instantiated, the
class is already overloaded, so it can't and describe() fails to populate the columns
array. Unfortunately, seeing the problem is not helping me see the solution =P
Does anyone have an idea for a workaround for this?
BTW, the DbTable class isn't tied to any particular table, so it should be easy to test against
any spare PostgreSQL tables you might have lying around (just change the test code).
TIA, Cliff
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php