1
0
mirror of https://tt-rss.org/git/tt-rss.git synced 2024-06-25 11:57:42 +02:00
ttrss/classes/db/stmt.php
2013-04-18 08:20:45 +04:00

33 lines
538 B
PHP

<?php
class Db_Stmt {
private $stmt;
private $cache;
function __construct($stmt) {
$this->stmt = $stmt;
$this->cache = false;
}
function fetch_result($row, $param) {
if (!$this->cache) {
$this->cache = $this->stmt->fetchAll();
}
if (isset($this->cache[$row])) {
return $this->cache[$row][$param];
} else {
user_error("Unable to jump to row $row", E_USER_WARNING);
return false;
}
}
function rowCount() {
return $this->stmt->rowCount();
}
function fetch() {
return $this->stmt->fetch();
}
}
?>