{"record":{"id":"ca61375ca760514f","repo":"octobercms/october","slug":"model-model-used-in-class-is-not-valid-it-must","errorCode":null,"errorMessage":"Model :model used in :class is not valid, it must inherit the \\Model class.","messagePattern":"Model :model used in :class is not valid, it must inherit the \\\\Model class\\.","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/backend/widgets/Lists.php","lineNumber":367,"sourceCode":"        $this->currentPageNumber = 1;\n\n        return $this->onRefresh();\n    }\n\n    /**\n     * validateModel is present and right class type\n     */\n    protected function validateModel()\n    {\n        if (!$this->model) {\n            throw new ApplicationException(Lang::get(\n                'backend::lang.list.missing_model',\n                ['class'=>get_class($this->controller)]\n            ));\n        }\n\n        if (!$this->model instanceof Model) {\n            throw new ApplicationException(Lang::get(\n                'backend::lang.model.invalid_class',\n                ['model'=>get_class($this->model), 'class'=>get_class($this->controller)]\n            ));\n        }\n\n        return $this->model;\n    }\n\n    /**\n     * parseTableName replaces the @ symbol with a table name in a model\n     * @param  string $sql\n     * @param  string $table\n     * @return string\n     */\n    protected function parseTableName($sql, $table)\n    {\n        return str_replace('@', $table.'.', $sql);\n    }","sourceCodeStart":349,"sourceCodeEnd":385,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/widgets/Lists.php#L349-L385","documentation":"Error \"Model :model used in :class is not valid, it must inherit the \\Model class.\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/backend/widgets/Lists.php:367 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"}