phalcon/cphalcon · error · Phalcon\Mvc\Model\Query\Exceptions\Builder\OperatorNotAvailable
Operator is not available.
Error message
Operator {operator} is not available. What it means
Generic guard in Builder::conditionBetween (and sibling condition helpers): the clause-joining operator is neither OPERATOR_AND ('and') nor OPERATOR_OR ('or'), so the helper cannot choose andOperator/orOperator. The input at fault is the operator argument passed to andWhere/orWhere-style APIs.
Solutions
- Pass only Builder::OPERATOR_AND or Builder::OPERATOR_OR as the operator argument.
- Fix programmatic callers that forward arbitrary strings (e.g. '&&', 'AND').
- Validate operator values at the public API boundary before reaching conditionBetween.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at phalcon/Mvc/Model/Query/Builder.zep:1646 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/85db5e8ed31854a6.
Report an issue: GitHub.
Appendix: source
Thrown at phalcon/Mvc/Model/Query/Builder.zep:1646
if typeof currentBindTypes == "array" {
let this->bindTypes = currentBindTypes + bindTypes;
} else {
let this->bindTypes = bindTypes;
}
}
return this;
}
/**
* Appends a BETWEEN condition
*/
protected function conditionBetween( string clause, string operator, string expr, var minimum, var maximum) -> <BuilderInterface>
{
var hiddenParam, nextHiddenParam, minimumKey, maximumKey, operatorMethod;
if unlikely (operator !== Builder::OPERATOR_AND && operator !== Builder::OPERATOR_OR) {
throw new OperatorNotAvailable(operator);
}
let operatorMethod = operator . clause;
let hiddenParam = this->hiddenParamNumber,
nextHiddenParam = hiddenParam + 1;
/**
* Minimum key with auto bind-params and
* Maximum key with auto bind-params
*/
let minimumKey = "AP" . hiddenParam,
maximumKey = "AP" . nextHiddenParam;
/**
* Create a standard BETWEEN condition with bind params
* Append the BETWEEN to the current conditions using and "and"
*/View on GitHub (pinned to b7419de9cd)