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

Parameter 'builder' is required

Error message

Parameter 'builder' is required

What it means

Validation in Paginator\Adapter\QueryBuilderCursor::__construct: the config array has no 'builder' key, so there is no query builder to paginate over. The input at fault is the paginator config array missing 'builder'.

Solutions

  1. Pass the query builder in the config: ['builder' => $builder, 'limit' => 10, ...].
  2. Validate the config in factory/service code before constructing the paginator.
  3. Ensure the variable holding the builder is not null/undefined at call time.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at phalcon/Paginator/Adapter/QueryBuilderCursor.zep:102 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/8f5d69e3c1c6785a. Report an issue: GitHub.

Appendix: source

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

     * 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();
        }

        let this->cursorColumn = cursorColumn;

        if fetch cursor, config["cursor"] {
            let this->cursor = cursor;

View on GitHub (pinned to b7419de9cd)