{"record":{"id":"c99bd605bc5125cc","repo":"octobercms/october","slug":"the-model-class-model-must-define-a-method-metho-c99bd6","errorCode":null,"errorMessage":"The model class :model must define a method :method() returning options for the ':filter' filter.","messagePattern":"The model class :model must define a method :method\\(\\) returning options for the ':filter' filter\\.","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/backend/filterwidgets/Group.php","lineNumber":281,"sourceCode":"            if (\n                count($staticMethod = explode('::', $options)) === 2 &&\n                is_callable($staticMethod)\n            ) {\n                $options = $staticMethod($model, $scope);\n\n                if (!is_array($options)) {\n                    throw new ApplicationException(Lang::get('backend::lang.field.options_static_method_invalid_value', [\n                        'class' => $staticMethod[0],\n                        'method' => $staticMethod[1]\n                    ]));\n                }\n            }\n            // Calling via $model->method\n            else {\n                $methodName = $options;\n\n                if (!$model->methodExists($methodName)) {\n                    throw new ApplicationException(Lang::get('backend::lang.filter.options_method_not_exists', [\n                        'model'  => get_class($model),\n                        'method' => $methodName,\n                        'filter' => $scope->scopeName\n                    ]));\n                }\n\n                // For passing to events\n                // @deprecated v4 review this interface to closer resemble the form field\n                // interface (FormField and FilterScope)\n                $holder = new ElementHolder($this->getParentFilter()->getScopes());\n                $options = $model->$methodName($holder);\n            }\n        }\n\n        if (!is_array($options)) {\n            $options = [];\n        }\n","sourceCodeStart":263,"sourceCodeEnd":299,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/filterwidgets/Group.php#L263-L299","documentation":"Error \"The model class :model must define a method :method() returning options for the ':filter' filter.\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/backend/filterwidgets/Group.php:281 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":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}