I'm used to writing a lot of functions for reusable code, but now I'm shifting over to OOP. So this is what I'm used to:
function getUsers(){
return selectQuery("SELECT * FROM `users` ORDER BY `last_name` ASC");
}
But now, should I create a completely separate class for the purpose of getting a list of users from the database? Something like:
class UsersList
{
public function __construct()
{
return selectQuery("SELECT * FROM `users` ORDER BY `last_name` ASC");
}
}