arrayiterator

[PHP] ORM Query results: Arrays vs Result handle wrapped in Iterator interface

Okay, here's one for the pro's: For a couple of years now, i've been working on my own PHP ORM/ActiveRecord implementation that i named Pork.dbObject. It's loosly based on the 'make your own site with rails in 5 minutes' movie we all saw a couple of years ago. You can do things like: $clients = dbObject::Search("Client", array("ID > 5...

How do I alter array keys and values while using a RecursiveArrayIterator?

I suspect I'm doing something stupid here, but I'm confused by what seems like a simple problem with SPL: How do I modified the contents of an array (the values in this example), using a RecursiveArrayIterator / RecursiveIteratorIterator? Using the follow test code, I can alter the value within the loop using getInnerIterator() and off...

Accessing array object variables when implementing RecursiveArrayIterator in RecursiveIteratorIterator

I have a large arrayObject which I'm looping over using the following:- $rit = new RecursiveIteratorIterator(new RecursiveArrayIterator($hierarchy)); foreach($rit as $key=> $val) { } How can I access the a specific key within the array? I can access them by echoing $key and the $val but I have specific keys I wish to access. If I att...