Thursday, February 26, 2009

RE: Model Q: HABTM association the right way to go?

No. Each table has a column called location_id. So the value of that column
in a row will correspond to a row in the id column of Location. That is how
the records in the tables are tied together.

-----Original Message-----
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Tim
Sent: Thursday, February 26, 2009 10:11 PM
To: CakePHP
Subject: Model Q: HABTM association the right way to go?


I'm not new to cake but I've never gotten into the associations and I'm a
little bit confused:

I have several tables:
- Projects
- Systems
- Organizations
- Volunteers
- Students
- Computers
- Divisions

and
- Location

Each table will be able to have a location so they all have a "location_id"
foreignKey.

Since location will belong to all the other tables I would have to do a
HABTM association correct?

If so, will I have to create all those joinTables?

Is there a easier way to do this without creating all those extra tables?


--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: