X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/1c68d1cde4a65ad065aad845d5672dd601ae5815..b0d5de1c50493b940cc128843eb3527716c04543:/lib/MECON/DB/Pager.php diff --git a/lib/MECON/DB/Pager.php b/lib/MECON/DB/Pager.php index db801af..b492bc3 100644 --- a/lib/MECON/DB/Pager.php +++ b/lib/MECON/DB/Pager.php @@ -60,9 +60,13 @@ require_once 'DB.php'; * @see http://vulcanonet.com/soft/pager/ */ -class MECON_DB_Pager extends PEAR +class MECON_DB_Pager extends DB_Result { + var $currentpage = 0; + var $current = 0; + var $to = 0; + /** * Constructor * @@ -100,7 +104,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 +123,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 +207,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 +222,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); } } ?>