Re: DB_DataObject and results
| From: | Justin Patrin | Date: | Fri, 06 Oct 2006 14:00:21 +0000 |
| Subject: | Re: DB_DataObject and results | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-25361@lists.php.net to get a copy of this message | ||
On 10/5/06, Chris Boget <chris.boget@wild.net> wrote:
I'm curious, why is the result object being stored in a global variable ($_DB_DATAOBJECT['Results'])? Why isn't it stored in a property/attribute? I'm trying to create an iterator (implementing the iterator interface) but I can't think of a clean way to initialize it with the result object... Has anyone had any experience setting up an iterator using DB_DataObject?It's stored in a global because the author didn't want to clutter the member vars of the object. Unfortunately he ended up using lots of member vars anyway so it didn't really gain much (although a print_r of a DO is generally of a usable size). If you're implementing an iterator I would suggest just having the DO be a member var and calling fetch() on it, then returning the DO. Then again I've never implemented an Iterator myself. ;-) -- Justin Patrin