Why doesn't CakePHP support multi-column foreign key?

I have searched google for this with no good result. The only thread I found in the CakePHP trac has been closed with no "real" explanation. Since CakePHP is like one of the rails ports for php and rails supports this, I would like to know why it does not support this feature.


OK. but I would like to work out how my db schema will be, in RoR you have a tool, if you want to use it, you do it at your own risk. By the way: I don't know if the symphony permits this.

+1


source to share


4 answers


Only the CakePHP team knows for sure. One of the teams, Nate Abdele, reported this about multi-column primary keys back in February 2007:

I could find a million other reasons why multi-column primary keys are a dumb idea, but I think the most important thing for 2007 is that it breaks down the REST architecture on the internet since there is no single point of reference to a piece of data, and that the data can now change on you without you knowing it, so objects can no longer be referenced by the same URI.



I guess this would be his argument against multi-column outer columns.

+6


source


Someone studying cake said this is best:



I am researching this, if something is ridiculously difficult to trick, you have design problems.
- asciimo

+5


source


Is it possible to achieve the same result by adding a condition with the second column to the association?

0


source


No, the real reason to support multi-column primary keys is to install CakePHP into an existing application. Don't encourage this type of practice because it's bad design, of course, but if you had the choice of using multiple primary keys and redesigning a large chunk of your existing administration system, a simple choice would be a very nice feature.

0


source







All Articles