For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > August 2006 > 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 Extending DB_DataObject
Derek Downey

2006-08-30, 9:58 pm

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

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com