{"record":{"id":"ec63c9802a30c488","repo":"phalcon/cphalcon","slug":"you-should-provide-model-class-name-for-paramkey","errorCode":null,"errorMessage":"You should provide model class name for {paramKey} parameter","messagePattern":"You should provide model class name for (.+?) parameter","errorType":"exception","errorClass":"Phalcon\\Mvc\\Model\\Exceptions\\MissingModelClassName","httpStatus":null,"severity":"error","filePath":"phalcon/Mvc/Model/Binder.zep","lineNumber":229,"sourceCode":"\n            let boundModel = null;\n            let paramValue = params[paramKey];\n\n            if className == Model::class {\n                if realClasses == null {\n                    if handler instanceof BindModelInterface {\n                        let handlerClass = get_class(handler);\n                        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;","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Mvc/Model/Binder.zep#L211-L247","documentation":"Thrown by Binder when the handler's getModelName() returned an array of parameter-name => model-class mappings but the array has no entry for the given paramKey, so the model class for that route parameter cannot be determined.","triggerScenarios":"Thrown at phalcon/Mvc/Model/Binder.zep:229 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add the missing parameter key to the array returned by getModelName(), matching the parameter name in the route/action signature","Or return a single model class string from getModelName() if only one model parameter exists","Verify the parameter name spelling in both the route definition and the action signature"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","contentChangedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}