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

Error "Parameters passed must be of type array, string, numeric or null in '{className}'" thrown in phalcon/cphalcon.

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 notified

View on GitHub (pinned to b7419de9cd)

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.