Re: Extending DB_DataObject
| From: | Justin Patrin | Date: | Thu, 31 Aug 2006 04:21:41 +0000 |
| Subject: | Re: Extending DB_DataObject | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-25022@lists.php.net to get a copy of this message | ||
On 8/30/06, Derek Downey <derekd@pmtads.com> wrote:
Ok, I figured it out. I wasn't paying attention and in my base class I had the following: function table() {return array()} function keys() {return array()} And was not overwritting them in the child class. (was using the auto generated files)Well.... You should probably return parent::table() and parent::keys() instead of just an empty array if you're not overwriting it somehow.
Apparently, I need to stop looking at the computer, but alas, I have work to do. Derek On 8/30/06 8:29 PM, "Derek Downey" <derekd@pmtads.com> wrote: Hi all, I'm kind of new to the PEAR packages, so please bear with me. I am using php5/mysql5 and am writing an application front-end to communicate with a database that contains several hundred thousand rows of data. That is how I stumbled upon DO. My question is it possible to extend DO past one child? For instance: MyDataObject_Base extends DB_DataObject MyDataObject_BaseExtender extends MyDataObject_Base Here's what I'm running into. At the beginning of the application, it calls the config options from a config.ini file. If I call a class extending DB_DataObject directly, the options are set. If I call a 'Base' class which itself extends DB_DataObject, the options aren't being set/retained. Any help is appreciated on this. Or if I can offer more info, I'd love to. Derek On 8/23/06 10:03 PM, "Chris Domigan" <cdomigan@gmail.com> wrote:-- Justin Patrin-- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpHi everyone, I'm having trouble working out how to test for a null value using DB_DataObject. If a field is set to NULL, the corresponding property in the data object is "", ie blank and not "null". Obviously it's very handy to be able to differentiate between an empty string and null. I've tried using the special sql casts that DB_DataObject supports, but this only lets me set null values, which I can already do anyway using $object->property = "null". Any help would be appreciated :) Chris