/** * @param DataMapper $object Should be cloned ahead of time * @param DB_result $query result from a CI DB query */ function __construct($object, $query) { // store the object as a main object $this->parent = $object; // clone the parent object, so it can be manipulated safely. $this->object = $object->get_clone(); // Now get the information on the current query object $this->result = $query->result(); $this->count = count($this->result); $this->pos = 0; }