Mvc\Model\Resultset

Abstract class Phalcon\Mvc\Model\Resultset

implements Phalcon\Mvc\Model\ResultsetInterface, Iterator, Traversable, SeekableIterator, Countable, ArrayAccess, Serializable

This component allows to Phalcon\Mvc\Model returns large resulsets with the minimum memory consumption Resulsets can be traversed using a standard foreach or a while statement. If a resultset is serialized it will dump all the rows into a big array. Then unserialize will retrieve the rows as they were before serializing.

//Using a standard foreach
 $robots = Robots::find(array("type='virtual'", "order" => "name"));
 foreach ($robots as $robot) {
  echo $robot->name, "\n";
 }

 //Using a while
 $robots = Robots::find(array("type='virtual'", "order" => "name"));
 $robots->rewind();