[dev] RDO::getFields()

Chuck Hagenbuch chuck at horde.org
Thu Mar 1 19:44:42 PST 2007


Quoting duck <duck at obala.net>:

> In RDO I am missing an getFields() method allowing me to get fields  
> as array. In a lot of cases I have functons/methods that expects  
> arrays as a parameter (like all PEAR classes). So I must always loop  
> every object and rewrite its data into an array. I know that exists  
> a SPL function iterator_to_array. But it would be much faster just  
> to retrieve the fields array rather than let PHP to do it for us.

You can extend the RDO base class if you really need to do this, but  
there are good reasons not to allow direct access to the fields array  
(at least, anything that wouldn't among other things completely miss  
relationships would be just as slow no matter how you did it).

Also, a lot of things that expect an array can just take the  
iterator... Any specific examples here?

-chuck

-- 
"we are plastered to the windshield of the bus that is time." - Chris


More information about the dev mailing list