You are now heading down the right track.  In a relational database
you create relations between directly linked tables and other tables
can then inherit those relations at higher levels.

You seem to have come to this conclusion yourself. By relating
'members' to 'payments', then relating 'payments' to 'member_years'
you can create a 2nd level link through 'payments' to 'members'.

However, in linking 'members' to 'payments' you have created a foreign
key which goes against CakePHP's naming conventions.  I would
recommend changing payments.pay_user to payments.member_id as for all
you have specified the alternative foreignKey name you are making life
harder for yourself by using your own naming conventions.

To further help you understand this concept it would be handy if you
could give us an example of what you are attempting to do with these
relations so we can show you what code you would use to do it.  What
is it your trying which leads you to believe the relationship is
failing and what steps have you taken to get there?

Personally I do not see the need for a 'member_years' table as you
could interrogate the date in the 'payments' table to find out what
years a member has paid up for.
--~--~---------~--~----~------------~-------~--~----~
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