result = $rs; $this->row_count = $rs->getRecordCount(); } function rewind(): void{ $this->pos = 0; } function valid(): bool { return ($this->pos < $this->row_count); } function key(): mixed { return $this->pos; } function current(): mixed{ if (!isset($this->result->cache[$this->pos])) { $this->result->cache[$this->pos] = $this->result->fetch(PDO::FETCH_ASSOC); } return $this->result->cache[$this->pos]; } function next(): void { $this->pos++; } function seek($index): void { $this->pos = $index; } function count(): int { return $this->row_count; } }