문제

I have the following associations

User hasOne Person

Person hasOne Contacts, Address, Student, and Employee

using saveAssociate I can create User and Person at the same time, however what I want is that I can also create Contacts, Address and either Student or Employee (determined by User.user_type) simultaneously.

can I do that with one call to saveAssociate? Or is there some other way?

도움이 되었습니까?

해결책

can I do that with one call to saveAssociate?

Yes - you can.

(It's shown quite clearly in the CakePHP book in the section about "Saving your data".)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top