I have read the documentation several times but bindModel is not
behaving as I expect. This is my issue:
I have user who has one profile and one resume. I am storing resume
in a separate table and I am not defining association in my models and
only using binding 'bindModel'. In my controller I do the following:
$this->User->bindModel(array('hasOne' => array('Profile', 'Resume')));
if ($this->User->saveAll($this->data, array('validate'=>'first'))){
........
}
So I get the following error (the error is referring to Resume):
Warning (512): SQL Error: 1364: Field 'user_id' doesn't have a default
value. I know I am doing something wrong because this behavior does
not match the one in the documentation (examples). I cannot figure
out where the problem is however.
I was not sure what other information you may need to look into this
and thought the above is sufficient for now. (let me know if you need
more information).
Any help is really appreciated.
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
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:
Post a Comment