Think I resolved it, but happy for someone to confirm if this is a
good solution.  When searching for issues surrounding Model::save
blanking the data array I came across a blog post on debuggable from
2007:

http://debuggable.com/posts/modelsave-now-returns-an-array:480f4dd6-0a7c-4026-ad5a-49c8cbdd56cb

Armed with the fact that I now knew Model::save returns Model->data I
changed the save function to the following:

$count = $joinModel->find('count', array(
  'fields'=>$assocData['associationForeignKey'],
  'conditions'=>array($assocData['foreignKey'] => $model->id)
));
$model->set($field, $count);
$model->data = $model->save($model->data, array('validate' => false,
'callbacks' => false));

By changing saveField() to save() and adding $model->data = in front
of the save call I retain my data array.

Paul

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 [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to