I'm wondering what the preferred approach for creating/naming models is?
My application has a "User" model, which contains all the relevant business logic for a creating, fetching, updating (etc) a User record.
In some of my controllers, I may want to fetch a list of multiple "User" records.
In this case, should I create a whole new model called Users?
The way I see it, there are a few options:
I can give database access to the controller, and the controller can query all the relevant users, then create a User model object as I loop through them. (BAD)
I can have two separate models, "User", and "Users". User object will handle creating, fetching, updating single records, and Users object would really only be useful for listing all the User records.
I don't like the idea of doing something like this:
$user = new User();
$user->fetchAll();
Purely for semantic reasons. A User object should relate to just one user record, in my opinion.
Maybe I'm thinking about this the wrong way, and my "User" model, which relates to the "users" table in the database, should really have been named "Users" from the start.
How do you deal with this issue?