I have a hasMany relation with the tables "documents" and
"documents_datas". When I update the form containing all related data
to the document all changes are stored correctly, apart the foreignKey
'document_id'. In the debugger the value for document_id is empty,
when saved.
Strange is, that when I check the value of the hidden form element in
the HTML code, the 'document_id' is present.
Why does it get lost when saving?
Models are:
<?php
class Document extends AppModel
{
var $name = 'Document';
var $hasMany = array(
'DocumentsData' => array(
'className' => 'DocumentsData',
'foreignKey' => 'document_id'
)
);
?>
and
<?php
class DocumentsData extends AppModel
{
var $name = 'DocumentsData';
var $belongsTo = 'Document';
}
?>
Thanks for any help.
Aldo
--~--~---------~--~----~------------~-------~--~----~
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