{"record":{"id":"a221793c96404efd","repo":"phalcon/cphalcon","slug":"unknown-model-or-alias-model-tag-when-pre","errorCode":null,"errorMessage":"Unknown model or alias '{model}' ({tag}), when preparing: {phql}","messagePattern":"Unknown model or alias '(.+?)' \\((.+?)\\), when preparing: (.+?)","errorType":"exception","errorClass":"UnknownModelOrAlias","httpStatus":null,"severity":"error","filePath":"phalcon/Mvc/Model/Query.zep","lineNumber":3207,"sourceCode":"            return [\n                \"type\": \"qualified\",\n                \"name\": columnName\n            ];\n        }\n\n        let metaData = this->metaData;\n\n        /**\n         * Check if the qualified name has a domain\n         */\n        if fetch columnDomain, expr[\"domain\"] {\n            let sqlAliases = this->sqlAliases;\n\n            /**\n             * The column has a domain, we need to check if it's an alias\n             */\n            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                }","sourceCodeStart":3189,"sourceCodeEnd":3225,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Mvc/Model/Query.zep#L3189-L3225","documentation":"Error \"Unknown model or alias '{model}' ({tag}), when preparing: {phql}\" thrown in phalcon/cphalcon.","triggerScenarios":"Thrown at phalcon/Mvc/Model/Query.zep:3207 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"}