You need to think of objects as actual entities. It sounds like your admin class might as well just be a file called admin_functions.php, with a set of admin related functions.
For example, as Stormrider mentioned, 'admin' isn't a real thing, it is a privilege. However 'user' is: it represents a person, has attributes like name, email etc, and methods like logout() so it is a candidate for an object:
PHP Code:
$currentUser = new User('name', 'pass');
if($currentUser->isAdmin() {
// allow doing of admin stuff here
}
Similar with article, it is a real thing, it has a title, text, a date etc so:
PHP Code:
$article = new Article('title' => 'My Article', 'text' => 'awesome story text');
$article->setPublished(true);
$article->save();
From there you can start to see what functions and variables your classes will need and can start fleshing out the code.
Bookmarks