(1-1/1)
It seems like what you're asking for is composite keys which PHP-AR does not support. Unfortunately, you would need to add conditions to issue your find. Composite keys is something I'd like to eventually support, but it's going to take quite a bit of effort.
(1-1/1)
June 27 2010
December 20, 2010 00:00
Subject: Help with Associations
For example, let's say I have a "Document" table, a "Chapters" table, and an "Articles" table.
Each Document has many Chapters, and each Chapter has many Articles. But, there are also multiple documents on the documents table.
So, on Articles table, I would need Document ID AND Chapter ID. How would I define the association on the Chapters model to connect to the Articles on Document ID AND Chapter ID? Would I have to connect it on the Document ID and then each time I do a Find add a condition to tie in the Chapter ID, or is there a way to define it totally on the model without having to use conditions on my Find?
Thanks!