Re: Re: DB_DataObject fetch methods
| From: | Alex Hayes | Date: | Wed, 10 Mar 2004 23:40:36 +0000 |
| Subject: | Re: Re: DB_DataObject fetch methods | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-26274@lists.php.net to get a copy of this message | ||
Im not sure I understand what your trying to say here alan. sorry...
I havent test Mark's class yet, however this is basically what I was
thinking...
I have come up with my own class, which uses the same method names as DB,
ie.. getOne, getAll, getAssoc, getRow (which is not really needed...) but im
just working on making it more efficient in the way it works, and also
trying to maintain all the functionality of these methods, for example
allowing the user to $DB_DataObject->setFetchMode() may also be a nice thing
to do. However its fastly coming apparant that there may be changes that
need to be made to the base class to allow greater efficiency both in terms
of lines of code, and processing power ;)
Anyway, Il keep working on it and let you know when I have finished.. (if i
do ;)
Any more thoughts before i get back into it?
thanks
alex
"Alan Knowles" <alan@akbkhome.com> wrote in message
news:404F9B34.6030204@akbkhome.com...
> $records[$key] = $dataobject->__clone () ;
> ** note this has changed to
> $records[$key] = clone($dataobject);
> in the next release (due to the PHP5 cloning method changing)
>
> I'm not 100% sure on adding a class like the one you attached. - it may
> seem simpler, but my initial feeling is that you are sacraficing a
> significant amount of code readiblity. - especially by doing magic
> things with keys.
>
> for the fetch method - the intention was to add something like:
> DB_DataObject::factory('thetable',array(
> 'condition' => .....,
> 'select' =>
> ....
> )
>
> I've not had time to look into the details of this.. - like how to
> implement inserts/updates/deletes using this factory + array...
>
> Regards
> Alan
>
>
>
>
>
>
> > }
> > return $records ;
> >
> > }
> >
> > }
> >
> >
> > ?>
> >
> > HTH
> >
> > Mark
> >