protected function tableInfo($tableName, $buffered = false) { if ($buffered !== true and array_key_exists($tableName, $this->tableInfo) or !array_key_exists($tableName, $this->tableInfo)) { $result = data::query("PRAGMA table_info('" . $tableName . "')"); $sqliteDriver = $this; data::forEachRow($result, function ($r) use($sqliteDriver, $tableName) { $sqliteDriver->tableInfo[$tableName][$r->name] = $r; }); } }
public function forEachRow($function = NULL) { if ($function === NULL) { if ($this->query == NULL) { $this->query = $this->select() or die(mysql_error()); } $r = mysql_fetch_object($this->query); if ($r == false) { $this->clearQuery(); } return $r; } else { $this->fireEvent('beforeforeachrow', $this); $query = $this->select(); data::forEachRow($query, $function); $this->fireEvent('afterforeachrow', $this); } }