Public Member Functions | |
getIterator () | |
Gets optimized SQLiteResultSetIterator. | |
seek ($rownum) | |
next () | |
getRecordCount () | |
getBlob ($column) | |
Performs sqlite_udf_decode_binary on binary data. | |
close () | |
Simply empties array as there is no result free method for sqlite. |
Definition at line 36 of file SQLiteResultSet.php.
SQLiteResultSet::close | ( | ) |
Simply empties array as there is no result free method for sqlite.
Implements ResultSet.
Definition at line 115 of file SQLiteResultSet.php.
SQLiteResultSet::getBlob | ( | $ | column | ) |
Performs sqlite_udf_decode_binary on binary data.
Reimplemented from ResultSetCommon.
Definition at line 100 of file SQLiteResultSet.php.
00101 { 00102 $idx = (is_int($column) ? $column - 1 : $column); 00103 if (!array_key_exists($idx, $this->fields)) { throw new SQLException("Invalid resultset column: " . $column); } 00104 if ($this->fields[$idx] === null) { return null; } 00105 require_once 'creole/util/Blob.php'; 00106 $b = new Blob(); 00107 $b->setContents(sqlite_udf_decode_binary($this->fields[$idx])); 00108 return $b; 00109 }
SQLiteResultSet::getIterator | ( | ) |
Gets optimized SQLiteResultSetIterator.
Reimplemented from ResultSetCommon.
Definition at line 42 of file SQLiteResultSet.php.
00043 { 00044 require_once 'creole/drivers/sqlite/SQLiteResultSetIterator.php'; 00045 return new SQLiteResultSetIterator($this); 00046 }
SQLiteResultSet::getRecordCount | ( | ) |
Implements ResultSet.
Definition at line 87 of file SQLiteResultSet.php.
Referenced by SQLiteResultSetIterator::__construct().
00088 { 00089 $rows = @sqlite_num_rows($this->result); 00090 if ($rows === null) { 00091 throw new SQLException("Error fetching num rows", sqlite_error_string(sqlite_last_error($this->conn->getResource()))); 00092 } 00093 return (int) $rows; 00094 }
SQLiteResultSet::next | ( | ) |
Implements ResultSet.
Definition at line 65 of file SQLiteResultSet.php.
References ResultSetCommon::afterLast().
00066 { 00067 $this->fields = sqlite_fetch_array($this->result, $this->fetchmode); // (ResultSet::FETCHMODE_NUM = SQLITE_NUM, etc.) 00068 if (!$this->fields) { 00069 $errno = sqlite_last_error($this->conn->getResource()); 00070 if (!$errno) { 00071 // We've advanced beyond end of recordset. 00072 $this->afterLast(); 00073 return false; 00074 } else { 00075 throw new SQLException("Error fetching result", sqlite_error_string($errno)); 00076 } 00077 } 00078 00079 // Advance cursor position 00080 $this->cursorPos++; 00081 return true; 00082 }
SQLiteResultSet::seek | ( | $ | rownum | ) |
Implements ResultSet.
Definition at line 51 of file SQLiteResultSet.php.
00052 { 00053 // MySQL rows start w/ 0, but this works, because we are 00054 // looking to move the position _before_ the next desired position 00055 if (!@sqlite_seek($this->result, $rownum)) { 00056 return false; 00057 } 00058 $this->cursorPos = $rownum; 00059 return true; 00060 }