*/ private array $currentRow = []; /** * Creates a new instance of SqliteResult. * * @param SQLite3Result $result Raw underlying result class. * @return SqliteResult A new SqliteResult instance. */ public function __construct( private SQLite3Result $result ) {} /** * Gets the number of columns per row in the result. * * @return int|string Number of columns in a row. */ public function getFieldCount(): int|string { return $this->result->numColumns(); } public function next(): bool { $result = $this->result->fetchArray(SQLITE3_BOTH); if($result === false) return false; $this->currentRow = $result; return true; } public function isNull(int|string $index): bool { return array_key_exists($index, $this->currentRow) && $this->currentRow[$index] === null; } public function getValue(int|string $index): mixed { return $this->currentRow[$index] ?? null; } public function close(): void {} }