This extension solves a very specific problem that I had. I need to generate dynamic results using thousands of very large ActiveRecords. Doing so was causing a memory overflow on shared hosts, so I wrote this helper class that uses pagination of a CActiveDataProvider but provides a simple Iterator interface to iterate over the records in batches.
It's not fancy, it's just useful.
Yii 1.1 or above
$activeDataProvider= new CActiveDataProvider('Post', ...); $iterator = new ActiveRecordIterator($activeDataProvider, 10); foreach ($iterator as $index => $record) { // Do Something amazing here }
Be the first person to leave a comment
Please login to leave your comment.