phalcon/cphalcon · error · Phalcon\Paginator\Exceptions\MissingRequiredParameter

Parameter 'limit' is required

Error message

Parameter 'limit' is required

What it means

Validation in Paginator\Adapter\QueryBuilderCursor::__construct: the config array has no 'limit' key, so the cursor paginator cannot determine its page size. The input at fault is the paginator config array missing 'limit'.

Solutions

  1. Always pass 'limit' in the config array, e.g. new QueryBuilderCursor(['limit' => 20, 'builder' => $b]).
  2. Validate config keys in factory code before instantiating the paginator.
  3. Provide a default limit at the call site when the user omits it.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at phalcon/Paginator/Adapter/QueryBuilderCursor.zep:98 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/39788beb9a2904bc. Report an issue: GitHub.

Appendix: source

Thrown at phalcon/Paginator/Adapter/QueryBuilderCursor.zep:98

     */
    protected string cursorColumn;

    /**
     * Phalcon\Paginator\Adapter\QueryBuilderCursor
     *
     * @param paginator_config $config = [
     *     'limit'        => 10,
     *     'builder'      => null,
     *     'cursorColumn' => 'id',
     *     'cursor'       => null
     * ]
     */
    public function __construct(array config)
    {
        var builder, cursorColumn, cursor;

        if unlikely !isset config["limit"] {
            throw new MissingRequiredParameter("limit");
        }

        if unlikely !fetch builder, config["builder"] {
            throw new MissingRequiredParameter("builder");
        }

        if unlikely !(builder instanceof Builder) {
            throw new InvalidBuilderInstance();
        }

        if unlikely !fetch cursorColumn, config["cursorColumn"] {
            throw new MissingRequiredParameter("cursorColumn");
        }

        if unlikely typeof cursorColumn != "string" || empty cursorColumn {
            throw new InvalidCursorColumn();
        }

View on GitHub (pinned to b7419de9cd)