* @see http://vulcanonet.com/soft/pager/
*/
-class MECON_DB_Pager extends PEAR
+class MECON_DB_Pager extends DB_Result
{
/**
*/
function MECON_DB_Pager (&$res, $from = 0, $limit = 10, $maxpages = 21, $numrows = null)
{
- $this->res = $res;
+ $this->dbh = $res->dbh;
+ $this->result = $res->result;
+ $this->row_counter = $res->row_counter;
+ $this->limit_from = $res->limit_from;
$this->from = $from;
$this->limit = $limit;
$this->numrows = $numrows;
{
// if there is no numrows given, calculate it
if ($this->numrows === null) {
- $this->numrows = $this->res->numrows();
+ $this->numrows = $this->numrows();
if (DB::isError($this->numrows)) {
return $this->numrows;
}
$this->current = $this->from - 1;
}
- function fetchRow($mode=DB_FETCHMODE_DEFAULT)
+ function fetchRow($mode=DB_FETCHMODE_DEFAULT, $rownum=null)
{
$this->current++;
if ($this->current >= $this->to) {
return null;
}
- return $this->res->fetchRow($mode, $this->current);
+ return $this->fetchRow($mode, $this->current);
}
function fetchInto(&$arr, $mode=DB_FETCHMODE_DEFAULT)
if ($this->current >= $this->to) {
return null;
}
- return $this->res->fetchInto($arr, $mode, $this->current);
+ return $this->fetchInto($arr, $mode, $this->current);
}
}
?>