{"record":{"id":"caedfa850163aa6d","repo":"phalcon/cphalcon","slug":"the-models-list-was-not-loaded-correctly","errorCode":null,"errorMessage":"The models list was not loaded correctly","messagePattern":"The models list was not loaded correctly","errorType":"exception","errorClass":"ModelsListNotLoaded","httpStatus":null,"severity":"error","filePath":"phalcon/Mvc/Model/Query.zep","lineNumber":3276,"sourceCode":"                    let hasModel = model;\n                }\n            }\n\n            /**\n             * After check in every model, the column does not belong to any of\n             * the selected models\n             */\n            if unlikely hasModel === false {\n                throw new ColumnNotInSelectedModels(columnName, \"1\", this->phql);\n            }\n\n            /**\n             * Check if the models property is correctly prepared\n             */\n            let models = this->models;\n\n            if unlikely typeof models != \"array\" {\n                throw new ModelsListNotLoaded();\n            }\n\n            /**\n             * Obtain the model's source from the models list\n             */\n            let className = get_class(hasModel);\n\n            if unlikely !fetch source, models[className] {\n                throw new ModelSourceNotFound(className, this->phql);\n            }\n\n            /**\n             * Rename the column\n             */\n            if Settings::get(\"orm.column_renaming\") {\n                let columnMap = metaData->getReverseColumnMap(hasModel);\n            } else {\n                let columnMap = null;","sourceCodeStart":3258,"sourceCodeEnd":3294,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Mvc/Model/Query.zep#L3258-L3294","documentation":"Error \"The models list was not loaded correctly\" thrown in phalcon/cphalcon.","triggerScenarios":"Thrown at phalcon/Mvc/Model/Query.zep:3276 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"}