I am writing an application that will allow two different types of
Users (tenant and manager) to create different linked objects
(properties, leases, and User), which they will be able to share.

Here is an example of how I want it to work:
1. A tenant creates and account and adds his Property and Lease.
2. He adds his landlord (a User, alias as Manager) and links the
Manager to the Property and Lease.
3. Manager signs up and effectively takes over the User account that
tenant created for him earlier.
4. Manager now has the ability to use the Property (created by tenant)
in other Leases (once the tenant lease expires, for example)

My problem isn't with the logic of doing all this, but rather how
should I set up my database tables to avoid creating more headaches
when I'm writing the app?

Right now, I'm thinking of giving the Lease table the following
fields:
tenant_user_id (the tenant's user id, if created by tenant)
manager_user_id (the manager's user id, if created by manager)
tenant_leases_id (a way to link multiple tenants to multiple leases;
the relationship between tenants and leases is HABTM)

Any pitfalls I'm missing?  Does anyone have a better or simpler way?


Thanks!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to