phalcon/cphalcon · error · MissingModelAttribute

The model '{model}' does not have the attribute '{attribute}

Error message

The model '{model}' does not have the attribute '{attribute}', when preparing: {phql}

What it means

Error "The model '{model}' does not have the attribute '{attribute}', when preparing: {phql}" thrown in phalcon/cphalcon.

Source

Thrown at phalcon/Mvc/Model/Query.zep:3865

            ];
        }

        let sqlInsert = [
            "model": modelName,
            "table": source
        ];

        let metaData = this->metaData;

        if fetch fields, ast["fields"] {
            let sqlFields = [];

            for field in fields {
                let name = field["name"];

                // Check that inserted fields are part of the model
                if unlikely !metaData->hasAttribute(model, name) {
                    throw new MissingModelAttribute(modelName, name, this->phql);
                }

                // Add the file to the insert list
                let sqlFields[] = name;
            }

            let sqlInsert["fields"] = sqlFields;
        }

        let sqlInsert["values"] = exprValues;

        return sqlInsert;
    }

    /**
     * Analyzes a SELECT intermediate code and produces an array to be executed later
     */
    final protected function prepareSelect(var ast = null, bool merge = false) -> array

View on GitHub (pinned to b7419de9cd)

When it happens

Trigger: Thrown at phalcon/Mvc/Model/Query.zep:3865 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/76d73c62f2e517ed. Report an issue: GitHub.