For clarity consider a fairly standard "User registration" functionality:
My ORM (Propel) allows you to alter the class ormUser, which extends the ormUserBase, in order to introduce custom functionality.
Now that I have coupled Propel with an MVC framework I am wondering which logic should go where from a best practice point of view.
For my user registration functionality I'd create:
RegistrationController - which uses the
UserModel - which in turn should call something like
- LoginView
- LogoutView
- SignupView
- ProfileView
The user database table is coupled with user-profile and Propel has generated handy methods to work with these tables. But now Propel's standard methods are not sufficient and I need to extend functionality.
Where would one do this correctly?
Would I only extend ormUser for new query methods and place non-query logic in my UserModel? Or would you simply ignore ormUser and use UserModel for everything custom, calling other ormTableNameClass-s there as needed for my logic?
I understand keeping new methods in Propel has the benefit of reusability in other Models and Controllers, but I'm not sure from a "do it correctly" point of view since it seems I need business logic to determine the outcome of certain queries.
UPDATE: Using ORM classes directly from the controller in MVC, bad practice? shows how one usually works with Propel, which in my mind overlaps the framework's model...