Re: Extending DB_DataObject

From: Date: Thu, 31 Aug 2006 02:42:21 +0000
Subject: Re: Extending DB_DataObject
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-25021@lists.php.net to get a copy of this message
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) 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: > >> >> Hi 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

« previous php.pear.general (#25021) next »