class MECON_DB_Pager extends DB_Result
{
+ var $currentpage = 0;
+ var $current = 0;
+ var $to = 0;
+
/**
* Constructor
*
*/
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;
{
// 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;
}
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)
if ($this->current >= $this->to) {
return null;
}
- return $this->res->fetchInto($arr, $mode, $this->current);
+ return parent::fetchInto($arr, $mode, $this->current);
}
}
?>