Specifying save fields

2009-06-07 Thread djXternal

I am trying to save some data using $this-Model-save($this-data,
false, array('title', 'desc', 'RelatedModel.id'))

Model belongsTo RelatedModel

$this-data is formatted:
array(
'Model' = array(
'title' = 'some data',
'desc' = 'some more data'
),
'RelatedModel' = array(
'id' = 'properly formatted id'
)
)

The problem I am having is both the title and desc fields are saving
properly but it is not filling in the RelatedModel's id into the
related_model_id field
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Specifying save fields

2009-06-07 Thread Miles J

If you are saving relations, you use saveAll().

http://book.cakephp.org/view/75/Saving-Your-Data

If not, change RelationModel.id to relation_model_id.
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Specifying save fields

2009-06-07 Thread djXternal

I tried the underscored notation, but I will try saveAll(), thanks.

On Jun 7, 6:49 pm, Miles J mileswjohn...@gmail.com wrote:
 If you are saving relations, you use saveAll().

 http://book.cakephp.org/view/75/Saving-Your-Data

 If not, change RelationModel.id to relation_model_id.
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---