phalcon/cphalcon · error · Phalcon\Mvc\Model\Exceptions\ColumnNotInTableMap
Column ' ' isn't part of the column map in
Error message
Column '{column}' isn't part of the column map in '{className}' What it means
Thrown while building primary-key conditions with column renaming enabled when the primary key column is missing from the column map, so its real field name cannot be resolved. Fix the column map to include that primary key column.
Solutions
- Add the missing primary-key column to the model's columnMap()
- Or disable orm.column_renaming if the schema matches attribute names
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at phalcon/Mvc/Model.zep:1566 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/0792441065cbcbdf.
Report an issue: GitHub.
Appendix: source
Thrown at phalcon/Mvc/Model.zep:1566
/**
* Create a condition from the primary keys
*/
for primaryKey in primaryKeys {
/**
* Every column part of the primary key must be in the bind data
* types
*/
if unlikely !fetch bindType, bindDataTypes[primaryKey] {
throw new BindTypeNotDefined(primaryKey, get_class(this));
}
/**
* Take the column values based on the column map if any
*/
if typeof columnMap == "array" {
if unlikely !fetch attributeField, columnMap[primaryKey] {
throw new ColumnNotInTableMap(primaryKey, get_class(this));
}
} else {
let attributeField = primaryKey;
}
/**
* If the attribute is currently set in the object add it to the
* conditions
*/
if unlikely !fetch value, this->{attributeField} {
throw new PrimaryKeyAttributeNotSet(attributeField, get_class(this));
}
/**
* Escape the column identifier
*/
let values[] = value,
conditions[] = writeConnection->escapeIdentifier(primaryKey) . " = ?",View on GitHub (pinned to b7419de9cd)