phalcon/cphalcon · error · Phalcon\Mvc\Model\Exceptions\InvalidFindParameters
Parameters passed must be of type array, string, numeric or…
Error message
Parameters passed must be of type array, string, numeric or null in '{className}' What it means
Thrown by Model::findFirst when parameters are not null, array, string or numeric — e.g. an object or nested invalid type was passed. Acceptable forms are a find id (string/numeric), an array of criteria, or null. Fix the arguments passed to findFirst.
Solutions
- Pass an array of query parameters, a numeric PK, a string, or null
- Cast variables of unknown type before calling findFirst()
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at phalcon/Mvc/Model.zep:1997 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/482696fed5db033e.
Report an issue: GitHub.
Appendix: source
Thrown at phalcon/Mvc/Model.zep:1997
* 'key' => 'my-find-key'
* ],
* 'hydration' => null
* ]
*
* @return T|\Phalcon\Mvc\Model\Row|null
*/
public static function findFirst(var parameters = null) -> var | null
{
var params, query;
if null === parameters {
let params = [];
} elseif typeof parameters === "array" {
let params = parameters;
} elseif typeof parameters === "string" || is_numeric(parameters) {
let params = [parameters];
} else {
throw new InvalidFindParameters(get_called_class());
}
let query = self::getPreparedQuery(params, 1);
/**
* Return only the first row
*/
query->setUniqueRow(true);
/**
* Execute the query passing the bind-params and casting-types
*/
return query->execute();
}
/**
* Fires an event, implicitly calls behaviors and listeners in the events
* manager are notifiedView on GitHub (pinned to b7419de9cd)