<?php
class kvframework_db_query{
private $closed = false;
private $query;
function __construct(mysqli_result &$q){
$this->query =& $q;
}
public function is_closed(){
return $this->closed;
}
public function close(){
$this->query->close();
$this->closed = true;
}
public function __call($m, $p){
if($m != "close" && $m != "is_closed"){
if($this->closed){
throw new kvframework_db_exception("Tried to call method on closed query.");
} else {
return call_user_func_array(array($this->query, $m), $p);
}
}
}
public function __get($v){
return $this->query->$v;
}
}