How Many HABTM relationships in cakephp is too many?

Posted by user559540 on Stack Overflow See other posts from Stack Overflow or by user559540
Published on 2010-12-31T23:46:05Z Indexed on 2010/12/31 23:54 UTC
Read the original article Hit count: 182

Filed under:

Hi all, I'm struggling with deciding how many HABTM relationships I really need in my cakephp app. I guess I don't quite get what "has" truly means. I don't want to have more HABTM tables than necessary. Here's what I have in my database:

Users Properties Leases Payments Repairs

user HABTM properties, user HABTM leases, user HABTM users, user HABTM repairs, property hasMany repairs, property hasMany leases, lease hasMany repairs.

Also, I have two aliases for my users model (manager and tenant). This is one of the reasons I ended up with so many HABTM relationships, but I'm not sure it's necessary.

Do I have too many user HABTM relationships? Would it be better to just have cake recurse through my models?

Thanks!

© Stack Overflow or respective owner

Related posts about cakephp