{"issue":{"state":"open","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"milestone":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/27659e10cd4f89b49d677aacc2ebc064?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"27659e10cd4f89b49d677aacc2ebc064","url":"https://api.github.com/users/thomasedwards","login":"thomasedwards","id":354995},"labels":[],"assignee":null,"updated_at":"2011-11-16T02:22:15Z","comments":2,"closed_at":null,"url":"https://api.github.com/repos/fuel/docs/issues/247","body":"On the Models page, the instructions for creating a Model are as such:\r\n\r\n```\r\nnamespace Model;\r\n\r\nclass Welcome extends Model {\r\n\r\n    public static function get_results()\r\n    {\r\n        // Database interactions\r\n    }\r\n\r\n}\r\n```\r\n\r\nWhich I’ve used in a Model I’ve made like so:\r\n\r\n```\r\nnamespace Model;\r\n\r\nclass Users extends Model\r\n{\r\n\r\n\tpublic static function create($pairs)\r\n\t{\r\n\t\treturn DB::insert('users')->set($pairs)->execute();\r\n\t}\r\n\r\n}\r\n```\r\n\r\nFirst error is ```ErrorException [ Error ]: Class 'Model\\Model' not found``` which is reasonable, as I haven’t created a Model class to extend from. So I remove that line.\r\n\r\n```\r\nclass Users\r\n```\r\n\r\nThen I get ```ErrorException [ Error ]: Class 'Model\\DB' not found``` referring to the line calling ```DB::insert```. That seems reasonable, because I’m in the Model namespace? But obviously I remove that, then the Controller can’t find the Model.\r\n\r\nI’m not sure what the correct way of managing it is?\r\n\r\nUsing 1.1 RC1","html_url":"https://github.com/fuel/docs/issues/247","title":"Confusion creating Model Classes","number":247,"id":2245739,"created_at":"2011-11-15T16:09:09Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/a9d84e5806ae0f82bbb902d71d6ecd88?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"a9d84e5806ae0f82bbb902d71d6ecd88","url":"https://api.github.com/users/crynobone","login":"crynobone","id":172966},"updated_at":"2011-11-16T02:22:15Z","url":"https://api.github.com/repos/fuel/docs/issues/comments/2754739","body":"```\r\nclass Users extends \\Model\r\n{\r\n\r\n    public static function create($pairs)\r\n    {\r\n        return DB::insert('users')->set($pairs)->execute();\r\n    }\r\n\r\n}\r\n```\r\n\r\nor alternatively\r\n\r\n```\r\nnamespace Model;\r\n\r\nuse Fuel\\Core\\DB;\r\n\r\nclass Model_Users extends \\Model\r\n{\r\n\r\n    public static function create($pairs)\r\n    {\r\n        return DB::insert('users')->set($pairs)->execute();\r\n    }\r\n\r\n}\r\n```","id":2754739,"created_at":"2011-11-16T02:22:15Z"}}