{"record":{"id":"f9d96e03a483bdab","repo":"phalcon/cphalcon","slug":"parameter-builder-must-be-an-instance-of-phalcon-f9d96e","errorCode":null,"errorMessage":"Parameter 'builder' must be an instance of Phalcon\\Mvc\\Model\\Query\\Builder","messagePattern":"Parameter 'builder' must be an instance of Phalcon\\\\Mvc\\\\Model\\\\Query\\\\Builder","errorType":"exception","errorClass":"Phalcon\\Paginator\\Exceptions\\InvalidBuilderInstance","httpStatus":null,"severity":"error","filePath":"phalcon/Paginator/Adapter/QueryBuilderCursor.zep","lineNumber":106,"sourceCode":"     *     'builder'      => null,\n     *     'cursorColumn' => 'id',\n     *     'cursor'       => null\n     * ]\n     */\n    public function __construct(array config)\n    {\n        var builder, cursorColumn, cursor;\n\n        if unlikely !isset config[\"limit\"] {\n            throw new MissingRequiredParameter(\"limit\");\n        }\n\n        if unlikely !fetch builder, config[\"builder\"] {\n            throw new MissingRequiredParameter(\"builder\");\n        }\n\n        if unlikely !(builder instanceof Builder) {\n            throw new InvalidBuilderInstance();\n        }\n\n        if unlikely !fetch cursorColumn, config[\"cursorColumn\"] {\n            throw new MissingRequiredParameter(\"cursorColumn\");\n        }\n\n        if unlikely typeof cursorColumn != \"string\" || empty cursorColumn {\n            throw new InvalidCursorColumn();\n        }\n\n        let this->cursorColumn = cursorColumn;\n\n        if fetch cursor, config[\"cursor\"] {\n            let this->cursor = cursor;\n        }\n\n        parent::__construct(config);\n","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Paginator/Adapter/QueryBuilderCursor.zep#L88-L124","documentation":"Constructor guard: the 'builder' entry in the config array was present but is not an instance of Phalcon\\Mvc\\Model\\Query\\Builder (e.g. a plain PHQL string, an array, or an object of the wrong class). The cursor paginator can only paginate a query produced by that Builder class.","triggerScenarios":"Thrown at phalcon/Paginator/Adapter/QueryBuilderCursor.zep:106 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a fully constructed Phalcon\\Mvc\\Model\\Query\\Builder as config['builder'], e.g. new Builder() with from()/columns()/where() configured","Verify no other Builder class (e.g. Phalcon\\Storage or a custom builder) is accidentally imported in the calling file","Check that the builder was not set to null or overwritten before being passed in the config array"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","contentChangedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}