{"record":{"id":"202e159991d44ebc","repo":"phalcon/cphalcon","slug":"there-is-no-model-related-to-model-or-alias-mode","errorCode":null,"errorMessage":"There is no model related to model or alias '{model}', when executing: {phql}","messagePattern":"There is no model related to model or alias '(.+?)', when executing: (.+?)","errorType":"exception","errorClass":"NoModelForAlias","httpStatus":null,"severity":"error","filePath":"phalcon/Mvc/Model/Query.zep","lineNumber":3224,"sourceCode":"            if unlikely !fetch source, sqlAliases[columnDomain] {\n                throw new UnknownModelOrAlias(columnDomain, \"11\", this->phql);\n            }\n\n            /**\n             * Change the selected column by its real name on its mapped table\n             */\n            if Settings::get(\"orm.column_renaming\") {\n                /**\n                 * Retrieve the corresponding model by its alias\n                 */\n                let sqlAliasesModelsInstances = this->sqlAliasesModelsInstances;\n\n                /**\n                 * We need the model instance to retrieve the reversed column\n                 * map\n                 */\n                if unlikely !fetch model, sqlAliasesModelsInstances[columnDomain] {\n                    throw new NoModelForAlias(columnDomain, this->phql);\n                }\n\n                let columnMap = metaData->getReverseColumnMap(model);\n            } else {\n                let columnMap = null;\n            }\n\n            if typeof columnMap == \"array\" {\n                if unlikely !fetch realColumnName, columnMap[columnName] {\n                    throw new ColumnNotInDomain(columnName, columnDomain, this->phql);\n                }\n            } else {\n                let realColumnName = columnName;\n            }\n        } else {\n            /**\n             * If the column IR does not have a domain, we must check for\n             * ambiguities","sourceCodeStart":3206,"sourceCodeEnd":3242,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Mvc/Model/Query.zep#L3206-L3242","documentation":"Error \"There is no model related to model or alias '{model}', when executing: {phql}\" thrown in phalcon/cphalcon.","triggerScenarios":"Thrown at phalcon/Mvc/Model/Query.zep:3224 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"}