overload() problem

From: Date: Mon, 22 Dec 2003 21:23:58 +0000
Subject: overload() problem
Groups: php.general 
Request: Send a blank email to php-general+get-173198@lists.php.net to get a copy of this message
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

« previous php.general (#173198) next »