Model(s) for one business logic with few database tables |
I use CodeIgniter 4 and I really like its Model class with all CRUD helpers.
My problem is I don't know how to design model(s) for business logic that uses multiple database tables. Let's say I want to handle meetings - each having a list of subjects to discuss. My database tables look like this (simplified): Code: CREATE TABLE meetings ( This would be very convenient to have two models like this: PHP Code: class MeetingsModel extends Model As far as I understand some people find above an anemic domain model anti-pattern and they claim it should not be used. Single business logic (e.g. handling meetings) should be implemented with a single model. Do you have any suggestions on how to handle such cases in a clean way and without re-implementing code that Model already provices? |
Welcome Guest, Not a member yet? Register Sign In |