So, here are instructions for creating our new type of iterators. First,
make your constructor (which has to have an array as a parameter) which calls
method to do whatever you have to do to make your objects. And, that
would be all.
make your constructor (which has to have an array as a parameter) which calls
_initialize()
function from Iterator class. Second, override _fetchObject
method to do whatever you have to do to make your objects. And, that
would be all.
In conclusion
Iterator will not slow down your application in a way that it will
need new hardware to run it. It has some overhead, but for that price
you get clean and easy readable code that is flexible enough for future
software enhancements.
need new hardware to run it. It has some overhead, but for that price
you get clean and easy readable code that is flexible enough for future
software enhancements.
You can download PHP Iterator from here