{"record":{"id":"f167bd4e8c6f2272","repo":"phalcon/cphalcon","slug":"cache-service-must-be-an-object-implementing-phalc-f167bd","errorCode":null,"errorMessage":"Cache service must be an object implementing Phalcon\\Cache\\CacheInterface or Psr\\SimpleCache\\CacheInterface","messagePattern":"Cache service must be an object implementing Phalcon\\\\Cache\\\\CacheInterface or Psr\\\\SimpleCache\\\\CacheInterface","errorType":"exception","errorClass":"Phalcon\\Mvc\\Model\\Exceptions\\InvalidResultsetCacheService","httpStatus":null,"severity":"error","filePath":"phalcon/Mvc/Model/Resultset.zep","lineNumber":189,"sourceCode":"            let this->rows = [];\n\n            return;\n        }\n\n        /**\n         * Valid resultsets are Phalcon\\Db\\ResultInterface instances\n         */\n        let this->result = result;\n\n        /**\n         * Update the related cache if any\n         */\n        if cache !== null {\n            if unlikely (\n                true !== is_a(cache,  CacheInterface::class) &&\n                true !== is_a(cache,  \"Psr\\\\SimpleCache\\\\CacheInterface\")\n            ) {\n                throw new InvalidResultsetCacheService();\n            }\n\n\n            let this->cache = cache;\n        }\n\n        /**\n         * Do the fetch using only associative indexes\n         */\n        result->setFetchMode(Enum::FETCH_ASSOC);\n\n        /**\n         * Consume the first row. The statement has already been executed by\n         * `Model\\Query::executeSelect()`, so this costs no extra round trip,\n         * and it is the only way to tell an empty result-set from a populated\n         * one without asking the driver for a row count - which SQLite can\n         * only answer by running a second statement.\n         */","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Mvc/Model/Resultset.zep#L171-L207","documentation":"Error \"Cache service must be an object implementing Phalcon\\Cache\\CacheInterface or Psr\\SimpleCache\\CacheInterface\" thrown in phalcon/cphalcon.","triggerScenarios":"Thrown at phalcon/Mvc/Model/Resultset.zep:189 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"}