{"record":{"id":"a82c30e24708e1a9","repo":"phalcon/cphalcon","slug":"getmodelname-should-return-array-or-string","errorCode":null,"errorMessage":"getModelName should return array or string","messagePattern":"getModelName should return array or string","errorType":"exception","errorClass":"Phalcon\\Mvc\\Model\\Exceptions\\InvalidGetModelNameReturn","httpStatus":null,"severity":"error","filePath":"phalcon/Mvc/Model/Binder.zep","lineNumber":237,"sourceCode":"                        let realClasses = {handlerClass}::getModelName();\n                    } elseif handler instanceof BindableInterface {\n                        let realClasses = handler->getModelName();\n                    } else {\n                        throw new HandlerMustImplementBindable();\n                    }\n                }\n\n                if typeof realClasses == \"array\" {\n                    if unlikely !fetch className, realClasses[paramKey] {\n                        throw new MissingModelClassName(paramKey);\n                    }\n\n                    let boundModel = this->findBoundModel(paramValue, className);\n                } elseif typeof realClasses == \"string\" {\n                    let className = realClasses;\n                    let boundModel = this->findBoundModel(paramValue, className);\n                } else {\n                    throw new InvalidGetModelNameReturn();\n                }\n            } elseif is_subclass_of(className, Model::class) {\n                let boundModel = this->findBoundModel(paramValue, className);\n            }\n\n            if boundModel != null {\n                let this->originalValues[paramKey] = paramValue;\n                let params[paramKey] = boundModel;\n                let this->boundModels[paramKey] = boundModel;\n                let paramsCache[paramKey] = className;\n            }\n        }\n\n        if cache != null {\n            cache->set(cacheKey, paramsCache);\n        }\n\n        let this->internalCache[cacheKey] = paramsCache;","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Mvc/Model/Binder.zep#L219-L255","documentation":"Error \"getModelName should return array or string\" thrown in phalcon/cphalcon.","triggerScenarios":"Thrown at phalcon/Mvc/Model/Binder.zep:237 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"}