views:

37

answers:

1

Let's say that I have two tables in my database:

users
countries

I have two defined relationships on each user belongsTo a country and each country hasMany users.. (CakePHP model relationships)

And I want to crate the model findUsersFromCountry($countryID) in wich class/model this method will be? It must be inside the User model or the Country model?

+1  A: 

What will your method return ? Or what kind of data will your method manipulate ?

If your method works on Users (it does), I would have it in the User class.

Pascal MARTIN