{"record":{"id":"ad1c1704c153f8fc","repo":"phalcon/cphalcon","slug":"eager-loading-does-not-support-the-offset-option","errorCode":null,"errorMessage":"Eager loading does not support the 'offset' option: a per-parent limit requires a window function, which PHQL cannot express","messagePattern":"Eager loading does not support the 'offset' option: a per-parent limit requires a window function, which PHQL cannot express","errorType":"exception","errorClass":"Phalcon\\Mvc\\Model\\Exceptions\\UnsupportedEagerOption","httpStatus":null,"severity":"error","filePath":"phalcon/Mvc/Model/Eager/PathTree.zep","lineNumber":91,"sourceCode":"        }\n\n        return tree;\n    }\n\n    /**\n     * A per-parent limit requires ROW_NUMBER() OVER (PARTITION BY ...), which\n     * PHQL has no syntax for. Applying `limit` to the batch query instead\n     * would return N children in total rather than N per parent, which is\n     * silently wrong.\n     */\n    private static function assertOptions(array options) -> void\n    {\n        if unlikely isset options[\"limit\"] {\n            throw new UnsupportedEagerOption(\"limit\");\n        }\n\n        if unlikely isset options[\"offset\"] {\n            throw new UnsupportedEagerOption(\"offset\");\n        }\n    }\n\n    /**\n     * @param array  $tree     accumulated tree\n     * @param string $path     the original path, for error messages\n     * @param array  $segments exploded path\n     * @param int    $index    segment currently being inserted\n     * @param array  $options  attach to the last segment only\n     */\n    private static function insert(\n        array tree,\n        string path,\n        array segments,\n        int index,\n        array options\n    ) -> array {\n        var node, segment;","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Mvc/Model/Eager/PathTree.zep#L73-L109","documentation":"Error \"Eager loading does not support the 'offset' option: a per-parent limit requires a window function, which PHQL cannot express\" thrown in phalcon/cphalcon.","triggerScenarios":"Thrown at phalcon/Mvc/Model/Eager/PathTree.zep:91 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}