[eluser]selfkill[/eluser]
For anyone who needs to have a different class and table names, I've found a somewhat hacky solution that has worked so far.
For example, I usually like to name my model classes with a "_model" at the end, so they don't muck up the namespace. So for a model named User_model with a table name of "users" I would do:
Code:
class User_model extends DataMapper {
public $model = 'user';
public $table = 'users';
...
}
If User_model has a relationship with another model named Group_model, I do this:
User_model:
Code:
class User_model extends DataMapper {
public $model = 'user';
public $table = 'users';
I haven't had a chance to test this a lot, but so far this seems to work. If it is a viable solution, perhaps it should be added to the FAQ because I had to do a lot of Googling to figure this out. As a feature request, I would like it if there was one simple way of specifying a different class name from a table instead of doing it like this. Until then, this seems to be the only way of going about it.