Re: What about DB_FETCHMODE_OBJECT in PEAR/DB.php?
| From: | Tomas V.V.Cox | Date: | Wed, 01 Aug 2001 15:06:21 +0000 |
| Subject: | Re: What about DB_FETCHMODE_OBJECT in PEAR/DB.php? | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-1215@lists.php.net to get a copy of this message | ||
"Stig S. Bakken" wrote:
>
> "Tomas V.V.Cox" wrote:
> >
> > Philip Hallstrom wrote:
> > >
> > > Hi -
> > > I was wondering why there isn't the option to fetch rows as
> > > objects in DB.php and friends? It doesn't look like it would be that hard
> > > to add... and I will if you want me to send you the patches...
> >
> > Other times this feature was suggested but always were rejected :) It's
> > true that doesn't seem to be very problematic to implement. Perhaps due
> > the amount of request we could re-think this matter. What do you thing
> > Stig?
>
> Sure, let's add DB_FETCHMODE_OBJECT. It'd still be cool to be able to
> specify which class the object should use (instead of the dumb
> "StdClass" you get when casting).
>
Umm.. perhaps we could extend the IMHO no very useful idea of fetching
objects and provide something new. For example methods:
$row->type('id');
$row->numFields();
$row->toFile('data');
I'll start to look at integrating the new fetchmode.
Tomas V.V.Cox
PD.- I CC'ed this msg to pear-dev so others could give more ideas.