/** 
   * Construct an IterablePearDbResult for DB_result
   * @param  DB_result $result  the DB result to iterate over
	 */ 
  function __construct($result) {
    if($result instanceof DB_result) {
      $this->result = $result;
      $this->rows = $result->numRows();
    }
    $this->setPageSize($this->getRowsCount());
  }
Beispiel #2
0
 /**
  * @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;
 }