X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/8d2c19500a7879269eea3dd92000899b6be90f69..ab08e58537352a82e34dab0684ae5997ece1899c:/lib/MECON/DB/Pager.php diff --git a/lib/MECON/DB/Pager.php b/lib/MECON/DB/Pager.php index bb030e7..b492bc3 100644 --- a/lib/MECON/DB/Pager.php +++ b/lib/MECON/DB/Pager.php @@ -63,6 +63,10 @@ require_once 'DB.php'; class MECON_DB_Pager extends DB_Result { + var $currentpage = 0; + var $current = 0; + var $to = 0; + /** * Constructor * @@ -100,10 +104,10 @@ class MECON_DB_Pager extends DB_Result */ function MECON_DB_Pager (&$res, $from = 0, $limit = 10, $maxpages = 21, $numrows = null) { - $this->res->dbh = $res->dbh; - $this->res->result = $res->result; - $this->res->row_counter = $res->row_counter; - $this->res->limit_from = $res->limit_from; + $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; @@ -119,7 +123,7 @@ class MECON_DB_Pager extends DB_Result { // 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; } @@ -209,7 +213,7 @@ class MECON_DB_Pager extends DB_Result 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) @@ -218,7 +222,7 @@ class MECON_DB_Pager extends DB_Result if ($this->current >= $this->to) { return null; } - return $this->res->fetchInto($arr, $mode, $this->current); + return parent::fetchInto($arr, $mode, $this->current); } } ?>