{"record":{"id":"8846d5c298aacb64","repo":"phalcon/cphalcon","slug":"the-returned-record-is-not-valid","errorCode":null,"errorMessage":"The returned record is not valid","messagePattern":"The returned record is not valid","errorType":"exception","errorClass":"Phalcon\\Mvc\\Model\\Exceptions\\InvalidReturnedRecord","httpStatus":null,"severity":"error","filePath":"phalcon/Mvc/Model/Resultset.zep","lineNumber":275,"sourceCode":"    public function delete(<Closure> conditionCallback = null) -> bool\n    {\n        bool result, transaction;\n        var record, connection = null;\n\n        let result = true;\n        let transaction = false;\n\n        this->rewind();\n\n        while this->valid() {\n            let record = this->current();\n\n            if transaction === false {\n                /**\n                 * We only can delete resultsets if every element is a complete object\n                 */\n                if unlikely !method_exists(record, \"getWriteConnection\") {\n                    throw new InvalidReturnedRecord();\n                }\n\n                let connection = record->getWriteConnection(),\n                    transaction = true;\n\n                connection->begin();\n            }\n\n            /**\n             * Perform additional validations\n             */\n            if typeof conditionCallback == \"object\" {\n                if call_user_func_array(conditionCallback, [record]) === false {\n                    this->next();\n\n                    continue;\n                }\n            }","sourceCodeStart":257,"sourceCodeEnd":293,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Mvc/Model/Resultset.zep#L257-L293","documentation":"Error \"The returned record is not valid\" thrown in phalcon/cphalcon.","triggerScenarios":"Thrown at phalcon/Mvc/Model/Resultset.zep:275 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":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}