query = $query; $this->conn = $conn; } function setInt($n, $value) { $this->binds [] = array($n, $value, PDO::PARAM_INT); } function setString($n, $value) { $this->binds [] = array($n, $value, PDO::PARAM_STR); } function setBlob($n, $value) { $this->binds [] = array($n, $value, PDO::PARAM_LOB); } function setLimit($limit) { $this->limit = $limit; } function setOffset($offset) { $this->offset = $offset; } function executeQuery() { if ($this->limit) { $this->query .= " LIMIT {$this->limit} OFFSET {$this->offset}"; } /*.Database_PDOStatement.*/$stmt = $this->conn->prepare($this->query); foreach ($this->binds as $bind) { list($n, $value, $type) = $bind; $stmt->bindValue($n, $value, (int) $type); } $stmt->execute(); $stmt->cache = $stmt->fetchAll(PDO::FETCH_ASSOC); return $stmt; } }