phalcon/cphalcon · error · Phalcon\Mvc\Model\Query\Exceptions\ResultsetRowClassNotFound

Resultset row class ' ' not found

Error message

Resultset row class '{className}' not found

What it means

Query::setResultsetRowClass() checks class_exists() on the supplied row class; if the class is not loaded/autoloable, ResultsetRowClassNotFound is thrown. The faulty input is the resultsetRowClass string — a typo or a class outside the autoloaded namespaces.

Solutions

  1. Use the fully-qualified class name of an existing Row subclass
  2. Register the class's namespace with the autoloader
  3. Fix typos in the class name string

Example fix

$query->setResultsetRowClass(MyRow::class); // must extend Phalcon\Mvc\Model\Row
Defensive patterns

Strategy: validation

Prevention

When it happens

Trigger: Thrown at phalcon/Mvc/Model/Query.zep:835 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/92b29bbbc03730ae. Report an issue: GitHub.

Appendix: source

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

    /**
     * Sets the type of PHQL statement to be executed
     */
    public function setType(int type) -> <QueryInterface>
    {
        let this->type = type;

        return this;
    }

    /**
     * Sets the class used to hydrate rows that are not mapped to a model
     * (custom columns/joins). The class must be a subclass of
     * Phalcon\Mvc\Model\Row.
     */
    public function setResultsetRowClass(string resultsetRowClass) -> <QueryInterface>
    {
        if unlikely !class_exists(resultsetRowClass) {
            throw new ResultsetRowClassNotFound(resultsetRowClass);
        }

        if unlikely !is_subclass_of(resultsetRowClass, Row::class) {
            throw new InvalidResultsetRowClass(resultsetRowClass);
        }

        let this->resultsetRowClass = resultsetRowClass;

        return this;
    }

    /**
     * Tells to the query if only the first row in the resultset must be
     * returned
     */
    public function setUniqueRow(bool uniqueRow) -> <QueryInterface>
    {
        let this->uniqueRow = uniqueRow;

View on GitHub (pinned to b7419de9cd)