Hi,

I need some guidance on how to build these model relationships.

I need to build something that allows people to book a room in an
accommodation. These are the steps.

User finds room.
User requests to stay in room
Owner accepts / declines
User Pays / finds another room.

I have 3 tables so far. Members, Accommodations, BookingRequests

At the moment I have the foreign key member_id in Accommodation. Do I
need to add it to BookingRequest as well?

This is what I store in each.


Members
id,email,password
Accommodation
id,member_id,title,room_type,price,price_week,price_month
BookingRequests
id,accommodation_id,checkin_date,checkout_date,message,read,member_id

The relationships are.

Members hasMany Accommodation
Accommodation hasMany BookingRequest, belongsTo Member
BookingRequest belongsTo Accommodation.

Any suggestions?

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 [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to