Home > Archive > PHP Pear > August 2006 > Re: [PEAR] Extending DB_DataObject
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: [PEAR] Extending DB_DataObject
|
|
| Derek Downey 2006-08-30, 9:58 pm |
| 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:
[color=darkred]
> 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 2006-08-31, 3:58 am |
| 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:
>
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Justin Patrin
|
|
|
|
|