Why won't you know if it is an admin user? How would you distinguish between the two in the database? Surely that distinction is enough to allow you to decide which class should be used. You might want to consider an abstact class with methods common to all users, and then User and AdminUser subclasses.
However to me that seems like confusing responsibilities. I would put 'admin functions' in a class of their own, or perhaps a few classes. Maybe an AdminUser manages regular Users, so I'd see the need for a UserManager class. But the distinction between Admin and Regular user would only exist in the database.
class User
{
private $status;
public function findUserById()
{}
public function isAdmin()
{
return $this->status == 1 ? true : false;
}
}
class UserManager
{
public function deleteUser( $userid )
{}
}
$user = new User();
$user->findUserById( 'admin' );
if( $user->isAdmin() )
{
$manager = new UserManager();
$manager->deleteUser( 'fred' );
}
Edit: got in there before me 🙂