سؤال

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