X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/1c68d1cde4a65ad065aad845d5672dd601ae5815..0dbb40b231defb31e62e2c0a56c1bc1abd85ec06:/lib/MECON/DB/Pager.php?ds=sidebyside diff --git a/lib/MECON/DB/Pager.php b/lib/MECON/DB/Pager.php index db801af..8aa5d60 100644 --- a/lib/MECON/DB/Pager.php +++ b/lib/MECON/DB/Pager.php @@ -60,7 +60,7 @@ require_once 'DB.php'; * @see http://vulcanonet.com/soft/pager/ */ -class MECON_DB_Pager extends PEAR +class MECON_DB_Pager extends DB_Result { /** @@ -100,7 +100,10 @@ class MECON_DB_Pager extends PEAR */ 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; @@ -116,7 +119,7 @@ class MECON_DB_Pager extends PEAR { // 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; } @@ -200,13 +203,13 @@ class MECON_DB_Pager extends PEAR $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 parent::fetchRow($mode, $this->current); } function fetchInto(&$arr, $mode=DB_FETCHMODE_DEFAULT) @@ -215,7 +218,7 @@ class MECON_DB_Pager extends PEAR if ($this->current >= $this->to) { return null; } - return $this->res->fetchInto($arr, $mode, $this->current); + return parent::fetchInto($arr, $mode, $this->current); } } ?>