phalcon/cphalcon · error · Phalcon\Mvc\Model\Exceptions\ResultsetColumnNotInMap
Column ' ' is not part of the column map
Error message
Column '{key}' is not part of the column map What it means
Thrown in Resultset\Simple while applying the column map to fetched rows (e.g. after setHydrate/toArray with renaming): a record key is not present in this->columnMap, so the row column cannot be renamed to its model property. The input at fault is the unexpected key returned by the database.
Solutions
- Refresh model metadata/column map caches so they include all columns returned by the query.
- Avoid selecting raw/aliased columns (columns(), COUNT(*), expressions) that produce keys outside the column map.
- Use hydration to arrays/stdClass for resultsets containing computed columns.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at phalcon/Mvc/Model/Resultset/Simple.zep:343 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of phalcon/cphalcon@b7419de9cd (2026-08-21).
Data as JSON: /api/errors/21599aea36709382.
Report an issue: GitHub.
Appendix: source
Thrown at phalcon/Mvc/Model/Resultset/Simple.zep:343
let columnMap = this->columnMap;
if typeof columnMap != "array" {
return records;
}
let renamedRecords = [];
if typeof records == "array" {
for record in records {
let renamed = [];
for key, value in record {
if (typeof key === "string") {
/**
* Check if the key is part of the column map
*/
if unlikely !fetch renamedKey, columnMap[key] {
throw new ResultsetColumnNotInMap(key);
}
if typeof renamedKey == "array" {
if unlikely !fetch renamedKey, renamedKey[0] {
throw new ResultsetColumnNotInMap(key);
}
}
let renamed[renamedKey] = value;
}
}
/**
* Append the renamed records to the main array
*/
let renamedRecords[] = renamed;
}
}View on GitHub (pinned to b7419de9cd)