{"record":{"id":"e4d1e895352ec112","repo":"yiisoft/yii2","slug":"datareader-cannot-rewind-it-is-a-forward-only-rea","errorCode":null,"errorMessage":"DataReader cannot rewind. It is a forward-only reader.","messagePattern":"DataReader cannot rewind\\. It is a forward-only reader\\.","errorType":"exception","errorClass":"yii\\base\\InvalidCallException","httpStatus":null,"severity":"error","filePath":"framework/db/DataReader.php","lineNumber":230,"sourceCode":"     */\n    public function getColumnCount()\n    {\n        return $this->_statement->columnCount();\n    }\n\n    /**\n     * Resets the iterator to the initial state.\n     * This method is required by the interface [[\\Iterator]].\n     * @throws InvalidCallException if this method is invoked twice\n     */\n    #[\\ReturnTypeWillChange]\n    public function rewind()\n    {\n        if ($this->_index < 0) {\n            $this->_row = $this->_statement->fetch();\n            $this->_index = 0;\n        } else {\n            throw new InvalidCallException('DataReader cannot rewind. It is a forward-only reader.');\n        }\n    }\n\n    /**\n     * Returns the index of the current row.\n     * This method is required by the interface [[\\Iterator]].\n     * @return int the index of the current row.\n     */\n    #[\\ReturnTypeWillChange]\n    public function key()\n    {\n        return $this->_index;\n    }\n\n    /**\n     * Returns the current row.\n     * This method is required by the interface [[\\Iterator]].\n     * @return mixed the current row.","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/yiisoft/yii2/blob/66f00d18a29b520f85e8e8f1e32d1e7e7b556cac/framework/db/DataReader.php#L212-L248","documentation":"Error \"DataReader cannot rewind. It is a forward-only reader.\" thrown in yiisoft/yii2.","triggerScenarios":"Thrown at framework/db/DataReader.php:230 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"66f00d18a29b520f85e8e8f1e32d1e7e7b556cac","analyzedAt":"2026-08-17T05:17:23.470Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}