Let's say I have two tables in a database: projects and users. I create two models, that extend Zend_Db_Table_Abstract: Model_DbTable_Users
and Model_DbTable_Projects
.
Now, is it a good pattern to create an instance of Model_DbTable_Projects
inside the Model_DbTable_Users
class ? In other words: is it OK to put any logic in this model, or should I create another class, that uses Model_DbTable_Users
and Model_DbTable_Projects
?
I use to put all the logic in models, that extend Zend_Db_Table_Abstract, but in large projects it can make code very unclean. So, can you give me any advice on models architecture(links on articles would be great!).