/framework/core/db/DbPgResult.php
http://zoop.googlecode.com/ · PHP · 56 lines · 47 code · 9 blank · 0 comment · 4 complexity · 7d4c89b199407bc22728869344abdb09 MD5 · raw file
- <?php
- class DbPgResult extends DbResultSet
- {
- private $cur;
- private $max;
-
- function __construct($link, $res)
- {
- parent::__construct($link, $res);
- $this->cur = 0;
- $this->max = pg_num_rows($this->res) - 1;
- }
-
- function numRows()
- {
- return $this->max + 1;
- }
-
- function rewind()
- {
- $this->cur = 0;
- }
-
- function current()
- {
- if($this->max == -1)
- return false;
- return pg_fetch_assoc($this->res, $this->cur);
- }
-
- function key()
- {
- return $this->cur;
- }
-
- function next()
- {
- $this->cur++;
- if($this->cur > $this->max)
- return false;
- return pg_fetch_assoc($this->res, $this->cur);
- }
-
- function valid()
- {
- if($this->cur > $this->max)
- return false;
-
- return true;
- }
-
- function affectedRows()
- {
- return pg_affected_rows($this->res);
- }
- }